Elaborating on my comment above, this seems like a bug in luaotfload
when in node
mode (the default font rendering mode which does more faithful OpenType processing), switching to base
mode fixes it (a more limited rendering mode that tries to map OpenType font feature to legacy TeX ligaturing mechanism as far as possible), for example:
% !TEX program = lualatex
\documentclass[letterpaper]{article}
\usepackage[hmargin=4.2in]{geometry}
\setlength\parindent{0pt}
\usepackage[no-math]{fontspec}
\setmainfont[Renderer=Basic]{EB Garamond}
\hyphenation{white-space Keynes-ian dwarf-ish calf-like wolf-fish ruff-like roof-top}
\begin{document}
whitespace Keynesian dwarfish calflike wolffish rufflike rooftop
\end{document}
Renderer=Basic
tells fontspec to use base
mode.
This can be a bug inherited from ConTeXt font code that luaotfload
re-packages for LaTeX and Plain, but not yet confirmed.
If you only need basic ligatures (and may be kerning, not sure), then basic
mode should be enough until this bug is solved.
I opened a luaotfload
issue to keep track of this bug.
Some thing like this using feature files should work:
First the feature file:
# scripts and languages, if the font use others they should be defined here too
languagesystem DFLT dflt;
languagesystem latn dflt;
# this undoes the effect of rare ligature on ft
feature liga {
sub f_t.alt by f t;
} liga;
# move rare ft to historic ligatures
feature hlig {
sub f t by f_t.alt;
} hlig;
# apply the regular ligature on ft and fft
feature liga {
sub f f t by f_f_t;
sub f t by f_t;
} liga;
The order of the above is important, this way regular “ft” and “fft” are used even with Rare
ligatures, but not with Historic
.
The glyph names should match those in the font with f_t.alt
being the name of the unwanted “ft” ligature, and f_t
& f_f_t
being the names of the wanted ones.
The full feature file syntax is documented by Adobe (but LuaTeX supports v1.6 f the syntax + FontForge extension, not the current one, so there are some differences).
Then it can be applied to the font by using FeatureFile
fontspec option:
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontspec[Ligatures={Common,Rare},FeatureFile=test.fea]{Garamond Premier Pro}
ft fft \em ft fft
\fontspec[Ligatures={Common,Rare,Historic},FeatureFile=test.fea]{Garamond Premier Pro}
ft fft \em ft fft
\end{document}
Best Answer
The fontspec package basically just activates certain features available in the font. The options differ depending on what type of font it is.
For OpenType fonts
The following table shows which options are available and which features they load (from the latest version of the fontspec package documentation, fontspec.pdf, 2020/02/21, § 3.1.8 with table 11 on p. 41):
What these do in the context of a specific font depends entirely on how the font designer set up that font. I would assume that fonts which make heavy use of such features come with a documentation that explains which ligatures are available and through which feature they are accessible. If not, you can inspect the font yourself using font editing software like FontForge or Glyphsapp (this will require that you can read OpenType feature code instructions).
If you want to know more about the features
rlig
,liga
,clig
etc., how they are intended to be used, how they differ from each other etc., you will find that information in the OpenType spec on the Microsoft website.Note that the option
TeX
above is different from the others, as you already seem to be aware (and user @cfr has also mentioned). A featuretlig
does not exist in the OpenType spec. This is something TeX-specific to emulate TeX's behaviour for interpreting certain ASCII input.For AAT-fonts (Apple)
For AAT-fonts, fontspec accepts the following
Ligatures
options (§ 3.1 in the documentation):Some information on what these do is available in the section Font Feature Registry in the AAT specification on Apple Developer. Again, it depends on the individual font what will actually happen when you activate these features. (Some of these are discouraged from use, e.g.
Logos
;Icelandic
does not seem to be mentioned in the spec).