[texhax] Need help with virtual fonts

Karl Berry karl at freefriends.org
Tue Jan 4 19:07:56 CET 2005


    I only want to make the
    substitution if the next character is a space

If it's ok to make the substitution at the end of a word, you could
perhaps use word boundary ligatures.  They're described in the vf and MF
documentation somewhere.  But it seems like these putative fancy swashes
wouldn't go well with a comma or period following.

I cannot quite picture how to detect a following space at the font
level.  I think it would have to be done at the macro level, and even
there it's not trivial.

    always turn an 'n' followed by a space into a fancy 'n' and then
    kern a little but wouldn't this interfere with the normal interword
    spacing that TeX tries to do? 

Yes (even if it could be done).

    Would this part of the code even see the space? I'm guessing it
    doesn't.

Right.  There is no "space character" per se by the time TeX is
typesetting fonts, the <space> (catcode 10) characters have turned into
interword glue, and you can't make a ligature with that.

    On a related note the font also has a "ct" ligature. How can I make
    sure it doesn't use this at the end of a word?

That should be doable with boundary ligatures.  At a word boundary,
typeset c, t.  At a non-boundary, typeset the ct ligature.

    I set it up so that I need 'n', space, space (can you say ugly) to turn
    it on?

With TeX macros, it could potentially be done.  But TeX collapses
multiple spaces into one very early.  So unless you typeset the whole
thing with \obeyspaces ... argh, it just gets worse.

    What I don't like about this is I change the entire
    font for the document then I need to remove all of them.

Well, if it's done with macros (\ct, \finaln, etc.), the macros could
perhaps be redefined to always do the standard thing (just insert "ct",
"n") with other fonts.  Still a drag, though, I agree.


You might try posting to tex-fonts at math.utah.edu if no other leads are
forthcoming, there are some other font folks there who don't read texhax.

Happy swashing,
karl



More information about the texhax mailing list