ttf is the abbreviation of true type font.

If we would like to specify some font to be used in QT app, we have to use QFont to specify the font by the font name. So the question is, how could we get the font name from ttf file.

We could use the fop-ttfreader utility (located in fop package for debian) to create the xml file which consist the information of the ttf file.

============================
From the package described in http://packages.debian.org/sid/fop

FOP is a Java application that reads a formatting object tree and then turns it into a wide variety of output presentations (including AFP, PCL, PDF, PNG, PostScript, RTF, TIFF, and plain text), or displays the result on-screen.

The formatting object tree can be in the form of an XML document (output by an XSLT engine like xalan) or can be passed in memory as a DOM Document or (in the case of xalan) SAX events.
============================

Then we could use the API as below:

fop-ttfreader font_to_be_check.ttf output.xml

and search the key word “<font-name>”

Then you will get <font-name>font_name_is_here</font-name>

Leave a Reply