[XeTeX] Font protrusion --- new or old ?

Jonathan Kew jonathan at jfkew.plus.com
Mon Feb 9 16:33:01 CET 2009


On 9 Feb 2009, at 04:57, Will Robertson wrote:

> On 2009-02-09 01:06:16 +1030, Jonathan Kew
> <jonathan at jfkew.plus.com> said:
>
>> Basically, borrow the ideas from Appendix D but use the transition
>> between class 255 (non-character) and whatever classes you assign to
>> the punctuation chars to insert the kerns.
>
> Well! That's quite amazing.
> I never even knew that class 255 was encountered at line start and  
> end.

It's "encountered" much more frequently than that; there's nothing  
special about line start/end. The interchar-toks mechanism considers  
there to be a class 255 pseudo-item wherever there is a boundary  
between a "run" of characters and something else -- glue, kern, math,  
box, etc., etc. So in practice that means at the start and end of each  
space-separated "word", as well as other places where markup and other  
non-character content is found.

>
> (Well, actually I never knew where it was found at all!)
>
> Will class 255 turn up in places where hanging punctuation won't be
> appropriate?

The idea of the kerns from Appendix D is that if a line-break isn't  
chosen here, they'll just cancel each other out; the hanging behavior  
arises from the way discardable items are removed when a break is  
chosen. So it shouldn't matter that this happens throughout the line,  
not just at the edges. After all, that's what Knuth's active  
characters did, too.

JK



More information about the XeTeX mailing list