Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to generate a preview of multiple TTF fonts without installing them.

Each font should have custom text, and the output should be 1 font per line in a format like JPEG or PDF, so that I could view them all at once.

I am using OS X but if there is a solution under Windows only I would be happy to try.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You could use ImageMagick, but it doesn't use native text rendering.

i=1; for f in *.ttf; do convert -size x30 -gravity center -font "$f" -pointsize 16 label:"${f##*/}: some text" font_$((i++)).png; done; convert -append font_*.png fonts.png

Or if the fonts have been installed, you could use /Library/Scripts/Font Book/Create Font Sample.scpt or a shell script like this:

preview=$(jot -s '' -c 89 33)

out="<table>
"
IFS=$'\n'
for font in Times Helvetica; do
    out+="<tr style=\"font-family:'$font'\"><td>$font</td><td>$preview</td></tr>
"
done
out+="</table>"

echo "$out" > /tmp/fonts.html
open /tmp/fonts.html
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.