[texhax] Need help with virtual fonts

Hartmut Henkel hartmut_henkel at gmx.de
Tue Jan 4 20:58:29 CET 2005


On Tue, 4 Jan 2005, Joel Coltoff wrote:

> I've used fontinst to install expert fonts and am comfortable with
> simple edits of the properties files. What is different about this
> case than adding an "ffl" ligature is that I only want to make the
> substitution if the next character is a space.

It's maybe comparable to the long-s and end-s handling of the Fraktur
fonts. I played with this once for some Zentenar-Fraktur after looking
into yfrak.pl, made from yfrak.tfm (CTAN) by tftopl. You could tweak
your font .pl file and trigger special glyphs by adding ligatures. If
it's only a few glyphs, maybe even no virtual font is required. Instead
of checking for the end of word, i checked whether there comes a
character after the s; then it's mapped to a long-s (D 92), therefore
the full list of small characters is needed (which is nasty, maybe
boundarychar mentioned by Karl does the trick much better). Here is a
rough example for the "s":

   (LABEL C s)
   (LIG C : D 127)  forces an end-s (D 127) if one types s:
   (LIG/> C a D 92)  makes a long-s followed by "a" (D 92)
   (LIG/> C b D 92)
   (LIG/ C c D 92)  starts a fake sc ligature
   (LIG/> C d D 92)
   ...
   (LIG/> C r D 92)
   (LIG/ C s D 92)  starts a fake ss ligature
   (LIG/ C t D 92)  starts a fake st ligature
   (LIG/> C u D 92)
   ...
   (LIG/> C z D 92)
   (LIG/> D 228 D 92)  various umlauts after long-s...
   (LIG/> D 246 D 92)
   (LIG/> D 252 D 92)
   (STOP)  if nothing fits (end of word), glyph "end-s" (D 115) is taken
   (LABEL D 92)  (long-s)
   (KRN C c R -0.05)  fake sc ligature
   (KRN C s R -0.05)  fake ss ligature
   (KRN C t R -0.05)  fake st ligature
   (STOP)

This requires to have the end-s at two places in the font, which can be
done by a tweaked re-encoding file. It's a hacky low-level approach, not
very flexible...

Regards, Hartmut



More information about the texhax mailing list