XEP Font Configuration Settings

This section describes RenderX XEP font configuration settings defined in the xep.xml file. Adobe Base-14 and some Windows fonts are predefined.

Earlier in the book, we learned that XSL processors are required to map XSL-FO generic fonts to specific fonts based output devices. In this tutorial, let's take a look at how RenderX XEP does this for PDF output files:

1. XEP uses a configuration file to control formatting options and font settings. The configuration file, xep.xml, is located at: \proga~1\RenderX\XEP\xep.xml. You can open it in a text editor to view and make changes.

2. The following settings in xep.xml control how XSL-FO generic fonts are mapped to specific fonts:

``` <fonts ...>
...
<font-alias name="monospace" value="Courier"/>
<font-alias name="sans-serif" value="Helvetica"/>
<font-alias name="serif" value="Times"/>
<font-alias name="cursive" value="Times"/>
<font-alias name="fantasy" value="Times"/>
</fonts>
```

3. The following settings in xep.xml control how "Courier" and other Adobe Base-14 fonts are defined:

```<fonts ...>
...
<font-group label="Base 14" embed="false" subset="false"
initial-encoding="standard">
<font-family name="Courier">
<font><font-data afm="Courier.afm"/></font>
<font style="oblique"><font-data afm="Courier-Oblique.afm"/></font>
<font weight="bold"><font-data afm="Courier-Bold.afm"/></font>
<font weight="bold" style="oblique">
<font-data afm="Courier-BoldOblique.afm"/>
</font>
</font-family>
...
</font-group>
</fonts>
```

As you can see from these settings, Adobe Base-14 fonts are defined through AFM (Adobe Font Metrics) files located at \proga~1\RenderX\XEP\fonts\Courier*.afm.

Attribute embed="false" indicates that the actual font data will not be embedded in the output file. In this case, the final viewer of the output file is responsible to provide the font data. Of course, Adobe Acrobat Reader knows how to provide font data for Adobe Base-14 fonts.

4. xep.xml comes with some additional specific fonts defined too. For example:

```<fonts ...>
...
<font-group xml:base="file:/C:/Windows/Fonts/"
label="Windows TrueType" embed="true" subset="true">
<font-family name="Arial">
<font><font-data ttf="arial.ttf"/></font>
<font style="oblique"><font-data ttf="ariali.ttf"/></font>
<font weight="bold"><font-data ttf="arialbd.ttf"/></font>
<font weight="bold" style="oblique">
<font-data ttf="arialbi.ttf"/>
</font>
...
</font-family>
...
</font-group>
</fonts>
```

As you can see from example, "Arial" is defined through TTF (TrueType Font) files located at C:/Windows/Fonts/arial*.ttf.

Attribute embed="false" and subset="true" indicate that a subset of the actual font data will be embedded in the output file to any glyphs used in the output. In this case, the final viewer of the output file will have the font data ready to use.

5. RenderX XEP allows us to add settings to define our own font families as we have font definitions and font data files. See next tutorials for more details.