Using DITA-OT 2.4.6, I can't get font mappings to work as expected. Actually, I can't get them to work at all.
My installation uses FOP 2.1 (which I gather is bundled with DITA-OT 2.4.6 -- I haven't installed it separately).
I'm following the instructions in
DITA for Print, Second Edition (p. 89), "Use a custom font family with font mapping". I'm using logical font mappings because DITA for Print says (p. 82):
"Unfortunately, FOP still doesn’t support per-character font selection, so if you’re using FOP, you might still need font mapping when your fonts don’t contain all the necessary glyphs. For example, if you’re using FOP and you need to display a word in Korean in the middle of a paragraph of English, and the font used by that paragraph doesn’t include any Korean glyphs, you’ll probably have to use font mapping."That is pretty much the situation with my content: there are words in Chinese characters embedded in paragraphs of English.
So, I've added a new logical font definition to
font-mappings.xml, like this:
<logical-font name="Tagline">
<physical-font char-set="default">
<font-face>AvenirLT-Light</font-face>
</physical-font>
</logical-font>
I want to use it on the title page, so I added the following line to
/cfg/fo/attrs/front-matter-attr.xsl:
<xsl:attribute name="font-family">Tagline</xsl:attribute>
Also added the appropriate import statement to
/cfg/fo/attrs/custom.xsl, e.g.:
<xsl:import href="front-matter-attr.xsl"/>And an import statement to
/cfg/fo/xsl/custom.xsl, e.g.:
<xsl:import href="front-matter.xsl"/>Since I'm not modifying any stylesheet behavior, the file
/cfg/fo/xsl/front-matter.xsl is empty, e.g.:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="2.0">
</xsl:stylesheet>
I have an ANT build script, and when I try to create the PDF, the font mapping fails.
The log file contains the following:
[fop] WARNING: Font "Tagline,normal,700" not found. Substituting with "any,normal,700".
Any suggestions?