font problem, possibly related to spaces in font name
Posted: Wed Aug 10, 2016 1:16 am
I'm working on an XSLt transformation from DITA using the FOP processor. I'm using the default DITA-OT 2.3 that comes with Oxygen, and the PDF2 plugin. Per instructions I read in a number of places, I created a customization directory and created pointers in catalog.xml to customization files for XSL processing, XSL attributes, and font mapping. I know I set this part up correctly, because most of my changes work fine.
The problem arises with the use of fonts. I want to use a particular font, called "Swis721 Lt BT", in my document. I checked to make sure that the FOP configuration file was set up to automatically process system fonts, so I then changed the physical font that is mapped to the "sans-serif" alias. At first I tried using the font I wanted, using the name that appeared as the font name under Windows (Swis721 Lt Bt). The parts of the document that are mapped as using "sans-serif" would appear in Helvetica (which was listed as one of the fallback fonts; if I remove the fallback fonts from the list, those portions of the document appear in Times). To make sure that the processor was able to get system fonts, I switched the alias "sans-serif" to use the font "Calibri." This time the document (or the portions specified as "sans-serif") appeared in Calibri. Just for fun, I also tried Algerian, and that worked. Swis721 Lt Bt won't work, however. I also tried a different font name that had a couple of spaces in the name, and it failed as well.
Suggestions as to how to fix this? Our company style guide calls for using the Swiss Light font.
Here is the relevant portion of the customized font-mappings.xml file:
The problem arises with the use of fonts. I want to use a particular font, called "Swis721 Lt BT", in my document. I checked to make sure that the FOP configuration file was set up to automatically process system fonts, so I then changed the physical font that is mapped to the "sans-serif" alias. At first I tried using the font I wanted, using the name that appeared as the font name under Windows (Swis721 Lt Bt). The parts of the document that are mapped as using "sans-serif" would appear in Helvetica (which was listed as one of the fallback fonts; if I remove the fallback fonts from the list, those portions of the document appear in Times). To make sure that the processor was able to get system fonts, I switched the alias "sans-serif" to use the font "Calibri." This time the document (or the portions specified as "sans-serif") appeared in Calibri. Just for fun, I also tried Algerian, and that worked. Swis721 Lt Bt won't work, however. I also tried a different font name that had a couple of spaces in the name, and it failed as well.
Suggestions as to how to fix this? Our company style guide calls for using the Swiss Light font.
Here is the relevant portion of the customized font-mappings.xml file:
Code: Select all
<aliases>
<alias name="serif">Serif</alias>
</aliases>
<aliases>
<alias name="sans-serif">Sans</alias>
</aliases>
<aliases>
<alias name="monospace">Monospaced</alias>
</aliases>
<aliases>
<alias name="Helvetica">Normal</alias>
</aliases>
<aliases>
<alias name="Courier">Monospaced</alias>
</aliases>
<!-- OXYGEN PATCH START Set fallback fonts for Asian and RTL languages. -->
<logical-font name="Sans">
<physical-font char-set="default">
<font-face>Swis721 Lt BT, Helvetica, Arial</font-face>
</physical-font>
<physical-font char-set="Simplified Chinese">
<font-face>AdobeSongStd-Light, Arial Unicode MS, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Japanese">
<font-face>KozMinProVI-Regular, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Korean">
<font-face>AdobeMyungjoStd-Medium, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Symbols">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SubmenuSymbol">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SymbolsSuperscript">
<font-face>Helvetica, Arial Unicode MS</font-face>
<baseline-shift>20%</baseline-shift>
<override-size>smaller</override-size>
</physical-font>
</logical-font>