Hacker News new | ask | show | jobs
by bemmu 4468 days ago
How would you solve choosing the right font size though? It should be such that the longest line perfectly fits the width.
1 comments

generate an imagemagick text label at a certain font size, then pipe it to identify -size , pull the width out of that and then use the result to calculate the required font size which you then use in a second textlabel

edit - or just generate a large text label to start with, then scale it to whatever is required