7

The luaotfload package in TeXLive 2016 has an interface to add new font features and replace the FeatureFile feature of fontspec in previous versions (see the following patch: https://github.com/wspr/fontspec/commit/92fca7272dbea8df664e4739e958a8d6843c9c09 It is not in CTAN yet)

I sort of figured out how to add new ligatures (by looking through the tlig feature in luaotfload)

However, what I want is to remove a certain ligature from a font. For example, some fonts, in particular those by Slimbach has a ligature for T h, which I would like to remove. Does anyone know how to do this using the addfeature of luaotfload.

Many thanks in advance.

3

You could make use of the selnolig package. Its main purpose is to let users suppress ligatures selectively, e.g., to suppress ligatures if they cross morpheme boundaries in composite words. (For instance, in the TeXbook, Don Knuth mentions the word "shelfful" as a word in which the ff ligature shouldn't be used.) However, the selnolig package can also be used to suppress ligatures globally. For instance,

\usepackage{selnolig}
\nolig{Th}{T|h}

will break up all Th ligatures in the entire document.

selnolig requires LuaLaTeX.

Full disclosure: I am the principal author of the selnolig package.

| improve this answer | |
  • This is good to know, but the question is really about how to do it on a font specific basis. Say my favorite monospaced font unfortunately does the ff ligature and I want to remove it, without removing the ligature from all other fonts in the document. – egreg Jun 11 '16 at 11:22
  • @egreg - I had read the OP's objective as wanting to suppress the Th ligature globally; the fact that not all fonts provide this particular ligature, to me, is less important. Quite possibly, though, I misinterpreted the objective. Let's see if the OP steps in and clarifies the objective. – Mico Jun 11 '16 at 11:27
  • @egreg It is indeed preferably to be able to do it on a font specific basis. Say, maybe for a particular font I do like the Th ligature even though it is unusual. In general I think ligature is a font feature (not even a typeface feature) and best to do on a font specific basis. On the other hand, for the problem I have at hand right now, this solution works perfectly. So I accepted the answer. – Yan Zhou Jun 11 '16 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.