Kerning example

Kerning is the adjusting of the fit of adjacent letters so that one fits over the other. xmlroff implements kerning using the kerning information in both TrueType and Type 1 fonts.

Kerning is used to improve the "look" of the page, since moving letters closer together reduces the whitespace between them. Letter pairs that are usually kerned include "To" and "WA", and some fonts have one thousand or more "kerning pairs" for specific combinations of characters.

The example just includes pairs of characters that are typically kerned. Whether or not a specific font contains kerning information for a pair of characters is dependent on the font.

Sample PDF output both with and without kerning is provided. In each PDF file, the sample text is shown twice, with a different font each time.

The following sections show the kerned and unkerned output for each font side-by-side. The 'Composite' images show the kerned and unkerned output overlaid, where the kerned output is saved as the red channel of the output image, and the unkerned output is saved as the green channel. Where the outputs coincide consequently appears as black.

Arial MT (TrueType)

With KerningWithout KerningComposite

Nimbus Sans L Regular (Type 1)

With KerningWithout KerningComposite

DocBookLibxslt SourceForge