[pdftex] easy font expansion

The Thanh Han hanthethanh at myrealbox.com
Tue May 11 12:13:48 CEST 2004


I did some (quite heavy) changes on pdftex to support font expansion, so
it can be used easily. So far the font expansion feature requires that
user must be able to create expanded tfm (eg cmr10+10.tfm). Now font
expansion can be used without expanded tfm. One can say:

\pdffontexpand\f 20 20 5 autoexpand

and pdftex will create those expanded tfm like cmr10+10, cmr10-20, etc.
automatically. This also works for virtual fonts (like utmr8t). pdftex
just creates those metrics in its memory; no expanded fonts are created
on disk.

The sources tarball and djgpp binaries are available at


For those interested in details of automatical font expansion:

1) a tfm is expanded by copying the metrics from the base tfm, then
character widths, kerns and italic corrections are adjusted.

2) for virtual fonts: nothing is changed apart from local font
definitions (they are automatically expanded just like (1)). This
means that some accents can be misplaced by a very small amount
(0.01--0.01pt). If this amount seems too much to you, then the wokraround
is to create expanded tfm manually.

A minimal test file can look like:

\pdffontexpand\font 20 20 5 autoexpand
\pdfadjustspacing 2

<A few long paragraphs here>

Then open the pdf file in acroreader and look at File->Info->Fonts, or
use pdffonts (comes from xpdf) to see whether the body font is expanded.

What is font expansion good for?

1) if you care about micro-typography like even word spacing and greyness of your

2) if you are typesetting narrow columns and would like to get rid of
those overfull/underfull boxes or frequent hyphenations with none (or
liltle) manual tweaking.

Feedbacks are welcome.


More information about the pdftex mailing list