I am using TeXlive 2016 on Ubuntu with LuaLaTex, all up to date. As of a week ago (or so), the following code worked for me. It defines a new, custom Open Type feature using Lua code, as described by others. In the Preamble:
\ExplSyntaxOn
\DeclareDocumentCommand \CreateFontFeature { m m }
{
\IfEndWith{#1}{,}{\StrGobbleRight{#1}{1}[\@fakezero]}{\def\@fakezero{#1}}
\def\@fakeone{["\@fakezero"}
\StrSubstitute{\@fakeone}{=}{"]="}[\@faketwo]
\StrSubstitute{\@faketwo}{,}{",\space["}[\@fakethree]
\directlua{
fonts.handlers.otf.addfeature {
name = "#2",
{type = "substitution", data = {\@fakethree},},
"feature #2 for some fonts",
}
}
}
%
\ExplSyntaxOff
\CreateFontFeature{emdash=emdash.alt}{emda}
%
\newfontfamily\agp[RawFeature=+emda]{Adobe Garamond Pro}
Then in the document, I use that font as {\agp text}
.
What it did was substutite the shorter emdash for the usual long one. Sadly, the shorter emdash is not in one of the OT feature sets.
Just today, I discovered that the above code no longer works. Apparently the +emda
is not being processed and passed to the font any more.
Possibility 1: In my total code, much too long to post here as a MWE, I did something that interfered with the above.
Possibility 2: I notice that there have been some recent updates to fontspec and luaotfload. An issue?
So my question is: Are any other user doing something like this? Experience, as of today?