A few hours ago, the following code worked perfectly (LuaLatex, TeXlive 2016 on Ubuntu):
\DeclareDocumentCommand \SetBaseFont { o m }
{ \__fontspec_pass_args:nnn \__fontspec_SetBaseFont:nn {#1} {#2} }
\cs_new:Nn \__fontspec_SetBaseFont:nn
{
\long\xdef\@basefontfeatures{#1}
\long\xdef\@basefontname{#2}
\global\@basefontsettrue
\ignorespaces
}
Now, it fails. In the intervening time, all I did was update texlive via tlmgr. No change to my own code. I did notice that fontspec was among the updated packages.
I have narrowed it down to the line with fontspec_pass_args
in it.
Anyone else having a similar problem?
EDIT: Definitely a change in fontspec code (says this humble user). I edited out \__fontspec_pass_args:nnn
everywhere it appeared in my own code. Then for my font definitions, unlike before, I needed to use the option brackets (even when no feature was needed): \SetBaseFont[]{Some Font}
and now my code compiles. Fortunately, whatever the problem code does, was not something I needed. Note that I used similar code for fonts with much simpler definitions, so it's not a matter of \long\xdef
or anything like that.
MORE EDIT:
In the log file (once I got my code to compile, by editing as described above) I see numerous messages that look like the following. I don't recall having seen them before, but maybe I just didn't notice. Since TU
relates to fontspec, here is an example. The problem was actually detected by microtype. All the fonts I use are Open Type:
Package microtype Warning: Unknown slot number of character
(microtype) `\textgreater '
(microtype) in font encoding `TU' in protrusion list
(microtype) `T1-default'.
Maybe that's related, maybe not.
YET MORE AGAIN:
My question actually answers itself! The reason that fontspec_pass_args
causes an error, is simply that the latest version of fontspec (2.5c, from three weeks ago) no longer has that command. So, if others are not experiencing my problem, it was because they are not mimicking the older fontspec code, in their own code. But the strange messages about TU are still there, and mysterious.