[Tex/LaTex] Substitute one glyph for an alternate glyph of another stylistic set

fontsfontspecluatexopentype

In LuaTeX, I want to do the following:

Having a text in the standard stylistic set of the font, but for a specific letter instead of having the glyph of the standard stylistic set, having it substituted by the glyph of an alternate stylistic set.

Example: in Arno Pro the Q of the first alternate stylistic set (Alternate=0) features a longer tail than the standard form. I would like that the compiler uses automatically the alternate Q glyph (and only the alternate Q glyph) for every occurence in my document.

Edit: Contextuals=Alternate or CharacterVariant={1-99} don't do the trick.

Best Answer

There is no general answer to this question, nor could there be. It’s not just that some designers misuse calt and other features, or disagree in their interpretation of the specification. Even if they all used features as they were meant to be used, fonts would still exhibit different behaviors.

Imagine that everyone agreed to use ss01 for Q, and ss02 for the ampersand. Now count the number of characters in human languages. If you still have time left, add the consideration that one font may have three alternate ampersands, two variations on Q, ornaments, etc. Clearly, there can be no universal agreement that ss03 controls this or that, because the possibilities are too numerous.

I’ve exaggerated the problem a little, because it would be odd to have separate stylistic sets for A, A with an acute accent, A with a grave accent, etc. And it may make sense to group alternates for different base characters in a single stylistic set; for example, a sans serif font may have all its humanist alternates in one set, and its geometric alternates in another. But the number of stylistic sets possible is limited, and it’s up to the designer to figure out the most useful way to arrange the stylistic alternates in a particular font into no more than twenty sets. A standard that made everything predictable to the user would hem in the unpredictable creativity of designers and fail to reflect the richness of human language and of its representation in type.

So when you acquire a new font, you need to study it and take notes on the features that interest you. I keep an Emacs org-mode file with tables of features and sample invocations for each of my fonts; however you prefer to keep your notes, you’ll waste a lot of time without notes.

If, upon examining a font, you discover that the designer has not provided a stylistic set affecting the one and only one character you have an interest in, then you can create a feature file to get what you want.

Related Question