Download "user manual"

Transcript
Oxygen XML Author plugin | Transforming Documents | 592
</renderer>
</renderers>
</fop>
The embed-url attribute points to the font file to be embedded. Specify it using the URL convention. The
metrics-url attribute points to the font metrics file with a path relative to the base element. The triplet
refers to the unique combination of name, weight, and style (italic) for each variation of the font. In our case is
just one triplet, but if the font had variants, you would have to specify one for each variant. Here is an example
for Arial Unicode if it had italic and bold variants:
<fop version="1.0">
...
<fonts>
<font metrics-url="Arialuni.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni.ttf">
<font-triplet name="Arialuni" style="normal"
weight="normal"/>
</font>
<font metrics-url="Arialuni-Bold.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni-Bold.ttf">
<font-triplet name="Arialuni" style="normal"
weight="bold"/>
</font>
<font metrics-url="Arialuni-Italic.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni-Italic.ttf">
<font-triplet name="Arialuni" style="italic"
weight="normal"/>
</font>
</fonts>
...
</fop>
More details about the FOP configuration file are available on the FOP website.
b) Open the Preferences dialog box, go to XML > XSLT/FO/XQuery > FO Processors, and enter the path of the
FOP configuration file in the Configuration file text field.
4. Set the font on the document content.
This is usually done 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 Arialuni) 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 Arialuni) to the parameters bodyFont and sansFont.
For DITA to PDF transformations using DITA-OT modify the following two files:
•
•
DITA_OT_DIR/plugins/org.dita.pdf2/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 (Arialuni in our example)
DITA_OT_DIR/plugins/org.dita.pdf2/fop/conf/fop.xconf - an element font must be inserted
in the element fonts which is inside the element renderer having the attribute
mime="application/pdf":
<renderer mime="application/pdf">
. . .
<fonts>
<font metrics-url="Arialuni.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni.ttf">
<font-triplet name="Arialuni" style="normal"
weight="normal"/>
</font>
</fonts>
. . .
</renderer>