Firebird Docset → Firebird Docwriters' Docs → Using non-Western fonts → 3: Create metrics files |
For every non-standard font you use, a file with font metrics information must be generated. Apache FOP needs this information while performing the XSL-FO -> PDF conversion. You can create the metrics files with the t1metrics and ttfmetrics targets in our build system. At the command prompt in manual/src/build, type (on one line!):
build ttfmetrics -Dff=D:\Path\To\fontfile.ttf -Dmf=filename.xml -Dsfx=xx
to build a TTF metrics file, or
build t1metrics -Dff=D:\Path\To\fontfile.pfm -Dmf=filename.xml -Dsfx=xx
for a Type 1 metrics file.
Please note:
You must provide the full path to the font file, but only a file name for the metrics file. The metrics file will be placed in manual/config/xx, with xx your language code.
You are free in your choice of the metrics file's basename, but it's wise to make it indicative of the font.
For the t1metrics target, you must specify the .pfm file, not the .pfb.
The second character of t1metrics is the digit 1 (one), not the letter el.
Combat RSI! You can save yourself no less than six keystrokes by omitting the sfx parameter and typing -Dmf=xx/filename.xml. (This is a relaxation of the first note.)
Remember that you must repeat this step for every font you add. If the bold and/or italic variations reside in different files, you must also create a separate metrics file for each variation.
Some TrueType fonts are packed together in .ttc files (TrueType collections). The ttcmetrics target allows you to build metrics files for such fonts:
build ttcmetrics -Dcf=D:\Path\To\collection.ttc -Dfn=fontname -Dmf=filename.xml -Dsfx=xx
The ff (font file) parameter has been replaced with cf (collection file), and there's an additional fn (font name) parameter. To find out which fonts are in a collection, call the ttcmetrics target with only the first parameter, like this:
build ttcmetrics -Dcf=D:\Path\To\collection.ttc
This will result in an exception and a 20-line Java stack trace, but just before that you'll find a list of all the fonts contained in the collection.
Firebird Docset → Firebird Docwriters' Docs → Using non-Western fonts → 3: Create metrics files |