[NTG-pdftex] easy font expansion

The Thanh Han The Thanh Han <hanthethanh@myrealbox.com>
Tue, 4 May 2004 09:45:25 +0700


Hi,

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:

\font\f=cmr10
\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 ptmr8t).

The sources tarball is available at

http://vntex.sourceforge.net/private/thanh/pdftex/pdftex-2004_05_02.tar.bz2

[to Hans Hagen: the djgpp binary of pdfxtex is avail. at the same
location]


I didn't submit this version to the texlive repository yet, because I
changed the sources quite a lot and it can introduce new bugs.

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>
\bye
=======================================

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
pages;

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 very much.

Thanh

PS: this version also fixes the problem with \mag