XML technologies / DocBook / Generating FO (PDF) / Modifying typography / Changing font style

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

The DocBook stylesheets provide several templates for changing the font style of an inline element. The table Font styles as format-independent template names lists the available options.

For example, to display an application element in italics, the following customization is sufficient:

<xsl:template match="application">
    <xsl:call-template name="inline.italicseq"/>
</xsl:template>

To use a sans-serif font as well, you need the attribute font-family:

<xsl:template match="application">
    <fo:inline font-family="{$sans.font.family}">
        <xsl:call-template name="inline.italicseq"/>
    </fo:inline>
</xsl:template>

The parameter sans.font.family contains the name of the sans-serif font.

  

back to top