[Tex/LaTex] Easily assign undefined ligatures with pdfLaTeX

fontsligaturespackagespdftex

Ulrike Fischer showed how Linux Libertine's special ligatures are accessible. Even though she also pointed me at a chapter of the LaTeX Graphics Companion, I'm not really sure how to get these ligatures automatically, probably because I'm by no means well versed in fonts and I'm not likely to ever be. What I'm eventually looking for is something like

\newligature{tt}{\libertineGlyph{uniE03C}}

which assigns the glyph at 0xeo3c (tt-ligature) to the input letter combination tt.

I'm assuming there is no package that can do this, but if it's possible, this could be a great addition to the list of packages that originated at tex.sx! Perhaps somebody who knows their way around the guts of (La)TeX could try to imitate the way the standard ligatures like ff are produced?

The code points of the Libertine ligatures are listed on page 87 of Libertine's German documentation for XeTeX, but I hope this solution will work for about any font. Obviously, using the ligatures with XeLaTeX is trivial, but I like being independent of fonts installed on my system, and with the solution desired here, you could specify exactly which ligatures you want.

Best Answer

This is not possible at LaTeX level; ligatures are defined in the .tfm file for the font and there's no way to change them (pdftex has only the possibility of clearing the list of ligatures for a particular font).

The strategy of making the t active in order to check if another t follows can work for limited amounts of text only, as it would break all command names containing a t.