16

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.

5
  • You can create a virtual font with a tt ligature. Some work, but IMO the only way to do that with these pesky 8-bit systems :)
    – topskip
    Oct 9, 2011 at 12:39
  • Now, where is the obligatory ConTeXt \translateinput or LuaLaTeX solution yet? Oct 9, 2011 at 12:52
  • @AndreyVihrov doncherry asked explicitly for pdftex. It should be easy to create a virtual font with LuaTeX on the fly so a TeX only solution is possible.
    – topskip
    Oct 9, 2011 at 13:16
  • @Patrick: I don't quite understand. Is LuaTeX "TeX only"? And there's "TeX only" that doesn't work with pdfTex? Generally, I guess I wouldn't mind a LuaTeX solution if it's impossible with pdfLaTeX.
    – doncherry
    Oct 9, 2011 at 13:21
  • 3
    @doncherry PDFTeX can't do this, it has to be done with virtual fonts. LuaTeX can create virtual fonts during a TeX run and use them directly. Perhaps I'll make a proof-of-concept.
    – topskip
    Oct 9, 2011 at 13:38

2 Answers 2

11

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.

18

The luatex-proof-of-concept I have promised is easier than I thought, because:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\begin{document}
Whatt?
\end{document}

already uses the tt-ligature.

But assume you want the fancy s_t ligature without enabling the Ligatures=Historic feature in fontspec, you can use a .fea-file:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[FeatureFile=myligatures.fea]{Linux Libertine O}
\begin{document}
strict
\end{document}

where the myligatures.fea is:

languagesystem DFLT dflt ;
languagesystem latn dflt ;
feature liga {
   sub s t  by s_t ;
} liga ;

This is an example (first line with regular ligatures + the myligatures.fea file and the second line with the Ligatures=Historic fontspec feature:

feature file fontspec

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .