Font Configuration
The PTC Arbortext Content Delivery Book Print uses the font files that are installed on the OS of the running server. To be able to use these fonts in your XSL-FO style sheets, or to use additional fonts, you may need to edit the configuration file FontSetup.xml located under folder InS_SW/Config/System/Config/Core/Version/Resources/Font.
The paths in FontSetup.xml file that is provided are according to the OS that the environment is installed on (these are relative paths to the font folder of your OS).
The FontSetup.xml configuration file is used to map the font family name in the XSL FO stylesheet to an actual font file, including variants (italic, slanted, bold, bold italic, , etc) as applicable. You can also define font substitution as a fallback for when a stylesheet selects a font family that is unavailable.
The format and syntax of the configuration file is essentially independent of the OS, what differs is how paths are expressed. Interpolate the examples below as needed.
To define a new font family, add a Font element, with a FamilyName attribute that defines the name of the font: <Font FamilyName="Times New Roman">
|
The value is not case sensitive.
|
The Font element can have any of the following children elements, each with a FontFile attribute that specifies the full path to the font file (i.e., usually, under the Fonts folder of the OS):
• Regular : Specifies the full path to the Normal font file.
• Bold : Specifies the full path to the Bold font file.
• Italic : Specifies the full path to the Italic font file.
• BoldItalic : Specifies the full path to the Bold-Italic font file.
For example, under Windows:
<Font FamilyName="Verdana">
<Regular FontFile="verdana.ttf"/>
<Bold FontFile="verdanab.ttf"/>
<Italic FontFile="verdanai.ttf"/>
<BoldItalic FontFile="verdanaz.ttf"/>
</Font>
|
Alternatively, you can specify a path to your fonts.
|
Substituting Fonts
To define a substitute font (i.e., a fallback font to use when a different one is specified in the XSL FO but is not available), add a Substitute element with the following attributes, as the first child element of FontList :
• OldFont : Specifies the name of the font to substitute.
• NewFont : Specifies the name of the font to use when the old font is specified.
<Substitute OldFont="Courier" NewFont="Lucida Console" />
You can also map a font list as a substitute (that is, a generic font name can be mapped to several fonts):
<Substitute OldFont="sans-serif" NewFont="Trebuchet MS, Tahoma,
Arial, Verdana, Helvetica" />
<Substitute OldFont="serif" NewFont="Bitstream Cyberbit, Times New Roman" />
Linux
On Linux the installation of the fonts is done manually. You will need to create your own FontSetup.xml file and to define the new fonts as detailed above. Set the paths to the fonts to the location of the installed fonts on your OS.
For example, a FontSetup.xml file on Linux where the fonts are located in /opt/Fonts/TrueType.
<FontList>
<Font FamilyName="Verdana">
<Regular FontFile="/opt/Fonts/TrueType/verdana.ttf"/>
<Bold FontFile="/opt/Fonts/TrueType/verdanab.ttf"/>
<Italic FontFile="/opt/Fonts/TrueType/verdanai.ttf"/>
<BoldItalic FontFile="/opt/Fonts/TrueType/verdanaz.ttf"/>
</Font>
<Font FamilyName="......">
<Regular FontFile="......"/>
<Bold FontFile="......"/>
<Italic FontFile="......"/>
<BoldItalic FontFile="......"/>
</Font>
<......>
<......>
</FontList>
Each element that points to a font file can have an optional FontIndex attribute. If the specified font file is a Collection file (.ttc file), specify in the FontIndex attribute the index of the font (0, 1, 2 ... {n-1}).
|
The default is 0, so, if you don't specify a FontIndex , you will get the first font automatically; the attribute is ignored if the file is not a Collection font.
|
For example :
<Font FamilyName="MS Gothic">
<Regular FontFile="msgothic.ttc" FontIndex="1" />
</Font>
To define a font family together with its variants, you add explicit styles and/or font weights to the font name. For example, you can add the following Font elements to the Verdana example above:
<Font FamilyName="Verdana Bold">
<Regular FontFile="verdanab.ttf"/>
<Italic FontFile="verdanaz.ttf"/>
</Font>
<Font FamilyName="Verdana Bold Italic">
<Regular FontFile="verdanaz.ttf"/>
</Font>
<Font FamilyName="Verdana Italic">
<Regular FontFile="verdanai.ttf"/>
<Bold FontFile="verdanaz.ttf"/>
</Font>
|
Specify only font mappings for which there are corresponding font files. For example: If you specify the same font for both 'Regular' and 'Italic', then the italic style will look exactly like the regular text. On the other hand, if the FO specifies ‘italic’ for a font that only has a ‘Regular’ mapping, the PTC Arbortext Content Delivery Book Print will slant the 'Regular' font.
|
Font Embedding
To embed a font in the generated PDF, use the attribute Embed="YES", otherwise, set Embed="NO".
In case you specified Embed="YES", you can also specify Subset="YES", in which case book print will embed only the characters in the font that are actually used.
|
The default behavior is to embed all fonts.
|
You can add the above attributes anywhere in FontSetup.xml:
• To set a default for all fonts: Add the attribute to the topmost FontList element.
• To set the properties for all versions of the font: Add the attribute to the Font element.
• To set the properties for specific font styles, add the attribute to the Regular, Bold, Italic and BoldItalic elements.
Typically, you would add a default setting to the root element and then override it for any non-standard font, which should be handled differently. For example:
<FontList Embed="NO" Subset="NO">
...
<Font FamilyName="Barcode">
<Regular Embed="YES" Subset="YES" FontFile="BARCODE.TTF"/>
</Font>
...
</FontList>