Download Oxygen XML Author 12.2
Transcript
Oxygen XML Author | Transforming Documents | 261
Other FO processors can be configured in the Preferences dialog.
Add a Font to the Built-in FOP - The Simple Version
If the font that must be set to Apache FOP is one of the fonts that are installed in the operating system you should follow
the next steps for creating and setting a FOP configuration file that looks for the font that it needs in the system fonts.
It is a simplified version of the procedure for setting a custom font in Apache FOP.
1. Register the font in FOP configuration. (not necessary in case of DITA PDF transformations, see next step)
a) Create a FOP configuration file that specifies that FOP should look for fonts in the installed fonts of the operating
system.
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
b) Set the FOP configuration file in Preferences.
Go to menu Options > Preferences > XML > XSLT/FO/XQuery > FO Processors and enter the path of the
FOP configuration file in the Configuration file for the built-in FOP text field.
2. Set the font on the document content.
This is done usually with XSLT stylesheet parameters and depends on the document type processed by the stylesheet.
•
•
•
For DocBook documents you can start with the predefined scenario called DocBook PDF, edit the XSLT parameters
and set the font name (in our example the font family name is Arial Unicode MS) to the parameters
body.font.family and title.font.family.
For TEI documents you can start with the predefined scenario called TEI PDF, edit the XSLT parameters and
set the font name (in our example Arial Unicode MS) to the parameters bodyFont and sansFont.
For DITA transformations using DITA-OT you should use an IDIOM FOP transformation and modify the
following two files:
•
•
${frameworks}/dita/DITA-OT/demo/fo/cfg/fo/font-mappings.xml - the font-face
element included in each element physical-font having the attribute char-set="default"
must contain the name of the font (Arial Unicode MS in our example)
${frameworks}/dita/DITA-OT/demo/fo/fop/conf/fop.xconf - an element auto-detect
must be inserted in the element fonts which is inside the element renderer having the attribute
mime="application/pdf":
<renderer mime="application/pdf">
. . .
<fonts>
<auto-detect/>
</fonts>
. . .
</renderer>
Add a Font to the Built-in FOP
If an XML document is transformed to PDF using the built-in Apache FOP processor but it contains some Unicode
characters that cannot be rendered by the default PDF fonts then a special font that is capable to render these characters
must be configured and embedded in the PDF result.