How to create font preview image from font file on Linux?

1.6k views Asked by At

I am wondering if there is any easy / possible way to create a "font preview image" file for a given font file on the Linux command line.

You know, like when you click on a font file in Linux or Windows file explorer and you get a little font preview window with "The quick brown fox jumps overs the lazy dog" in different sizes etc.

The input font file would be .PFB (Adobe type 1 font) or .TTF (TrueType font).

So, for example:

createfontpreviewimage somefont.pfb

[which creates somefontpreview.png or whatever]

Any thoughts? Or will I have to go down the hard work route of embedding the font file in a PDF document and generating the preview as a PDF document with PDFLib or some such?

2

There are 2 answers

0
Tobey Wheelock On
0
Artur Marnik On

Write simple PHP script and use imagettftext() function to generate your images