Since 2016, fontspec
no longer supports standard OTF feature files. These files made it possible to define sophisticated custom changes to the way an OpenType font is processed. That feature file format, developed by Adobe some 20 years ago, is well-established, well-documented, and independent of operating systems and typesetting applications.
The fontspec
manual provides a very small example of the new procedure that's supposed to be used in place of the previous one -- and, in case of any further questions, refers us to the manual of luaotfload
, which apparently is the cause of these changes.
However, that manual doesn't seem to address the question that's crucial here (leaving aside the question of what's so bad about Adobe's format that it had to be abandoned): How do we transform the things that we used to do, very easily, in that feature file format into the format that luaotfload
now seems to require?
If we go back to the fontspec
manual (which, in contrast to luaotfload
's, at least give us one example), we see that the new syntax is a lot different from Adobe's one.
Whereas, previously, we would say, e.g., for a simple substitution:
substitute k by k.alt;
...we're now supposed to say
["k"] = "k.alt",
...as in this example, based on the one from the manual:
\documentclass{article}
\usepackage{fontspec}
\directlua{
fonts.handlers.otf.addfeature {
name = "kalt",
type = "substitution",
data = {
["k"] = "k.alt",
}
}
}
\setmainfont{Minion Pro}[RawFeature=+kalt]
\begin{document}
okay
\end{document}
But that's about all we can gather from there. How do we do all the other things that we used to do? What, for example, would be the syntax expected by luaotfload
for a contextual substitution that I used to use with Matthew Carter's ›Miller‹ typeface which offers two slightly diffent capital R
s:
substitute R' [a c d e g o q s u adieresis odieresis udieresis C G O Q S U Odieresis Udieresis] by R.salt;