Firebird Docset → Firebird Docwriters' Docs → Using non-Western fonts → 4: Create FOP userconfig file |
This is the most complicated step. You have to edit the fop-userconfig.xml file to tell FOP:
which fonts (and variations) are to be included;
where the font files can be found;
where the metrics files can be found.
OK, let's go for it:
If necessary, copy fop-userconfig.xml from the general manual/config dir into your language subdirectory (e.g. manual/config/ja).
Open the file in a text or XML editor and find the fontBaseDir entry. Replace “xx” in the value with your language code, so that the URL points to the correct config subdirectory. Uncomment the entry!
Now go on to the <fonts> element. You will find some commented-out example fonts already present.
Insert a <font> element for the first font to add:
<font metrics-file="msmincho.xml" kerning="yes" embed-file="file:///D:/WINNT/Fonts/MSMincho.ttf"> <font-triplet name="MSMincho" style="normal" weight="normal"/> </font>
Notes:
metrics-file, of course, refers to the font metrics file you've created before, and which is in the same folder as fop-userconfig.xml.
embed-file must be a URL pointing to the font file itself. Attention! For Type 1 fonts, you must specify the the .pfb file here, not the .pfm like you did when creating the metrics file.
The font-triplet name must be the same as the name you used in fo-params.txt to override the default font.
Now you have to add information for the bold, italic, and bold-italic variations of the font. Often these come from different font files and you will have generated separate metrics files for them. If that is indeed the case, each variation gets its own <font> entry, e.g. for bold-italic:
<font metrics-file="msmincho-bi.xml" kerning="yes" embed-file="file:///D:/WINNT/Fonts/MSMinchoBI.ttf"> <font-triplet name="MSMincho" style="italic" weight="bold"/> </font>
Note that the font-triplet name must be the same for each variation: the name you used in fo-params.txt.
Sometimes there are no bold or italic variations of a font. In that case you must “fake it”, because the intermediate .fo file does specify these variations in places, and if they don't seem to exist you'll get the dreaded ### #### ## in the PDF again. For every non-existing variation, add a <font-triplet> element to the variation that should be used instead:
<font metrics-file="msmincho.xml" kerning="yes" embed-file="file:///D:/WINNT/Fonts/MSMincho.ttf"> <font-triplet name="MSMincho" style="normal" weight="normal"/> <font-triplet name="MSMincho" style="italic" weight="normal"/> </font>
If neither bold nor italic exist, you'll end up with four <font-triplet> children in the <font> element.
Repeat items 4 and 5 for every font family you've added to fo-params.txt.
If everything has gone right, you should now be able to generate PDFs in your language.
Firebird Docset → Firebird Docwriters' Docs → Using non-Western fonts → 4: Create FOP userconfig file |