Behavior in the presence of kerning and ligature

Karl Berry karl at
Wed Oct 16 00:29:26 CEST 2019

Hi Didier,

    But my question is this: suppose a font has a special kerning between
    characters A and B, and also a ligature between B and C (giving L), and
    suppose my input is ABC. What happens?

Have to try it to be sure. At least, I can't easily find a definitive
statement in tex.web/texbook.tex/etc.

    1. kern is applied, then ligature is created: A (kern) L, but this could
       be regarded as wrong because the kern wasn't really about A and L,

Indeed. That would seem like a bad bug.

    2. ligature is applied so that the input is AL, and there's no kerning
       between those, 

That would be my assumption (and hope). At the time that TeX reads the
B, it knows that it starts a ligature, so it could/should also know not
to insert a kern between A and B, yet. 

       except that it feels in contradiction with the way
       characters are eaten,

Input characters cannot get eaten and processed one at a time.  Problems
can arise even without kerns in the picture. The situation with only
ligatures can get complicated too, especially with the complex
"cursor"-moving ligatures (which I've never understood how to make any
practical use of). From Appendix F of the mfbook:

    Vertical bars to the left or right of `|=:|' tell \TeX\ to retain
    the original left and/or right character that invoked a
    ligature. Additional `|>|' signs tell \TeX\ to advance its focus of
    attention instead of doing any further ligtable operations at the
    current character position.

Yeah, sure. I get the idea, but ...

TeX can only go back and decide which ligature characters and kern items
to insert after it reaches the definite end of a given ligkern program,
I believe.

Good luck,

More information about the texhax mailing list