[pdftex] auto letter spacing

Thanh Han The hanthethanh at gmail.com
Wed Dec 13 18:07:58 CET 2006


On Wed, Dec 13, 2006 at 01:48:20PM +0100, Siep Kroonenberg wrote:
> On Tue, Dec 12, 2006 at 10:31:09PM +0100, Reinhard Kotucha wrote:
> > There is also the problem what to do with inserted spaces at the
> > beginning/end of letterspaced text:
>
> Isn't that what the boundarychar character is for? Of course this
> would also kick in at regular spaces, but you can compensate for
> that by adjusting the width of a space.

the current approach is that the kern inserted at each side
of a character is fixed. For example if we have:

,--------
| \font\f=cmr10
| \letterspacefont\fx=\f 100
`--------

then each character from \fx will have a kern by
50*quad(\fx)/1000 inserted at each side. Thus one can
compensate that kern manually if needed, for example when
using \fx inside a hbox.

In a multiple line paragraph, one can compensate that
kern at the margin by using margin kerning like follows:

\pdfprotrudechars=2
\newcount\n
\n=0
\loop
    \lpcode\fx\n 50
    \rpcode\fx\n 50
    \advance\n 1
\ifnum\n<256\repeat


Thanh


More information about the pdftex mailing list