[Tex/LaTex] fontspec, lua, microtype: Renderer=Basic no longer working for specific font styles

fontspecluatexmicrotypeopentypesmall-caps

You may have noticed that, as of now,* letterspacing small capitals is not as easy as it was in pdfTeX, where we could simply combine \textsc with microtype's \textls. Consider this example, which should give you non-letterspaced small caps; letterspaced u&lc; and letterspaced u&lc again:

(ex. 1)

\documentclass{article}
\usepackage{fontspec,microtype}

\listfiles
\setmainfont[
%Renderer=Basic
]{Minion Pro}

\begin{document}
\textsc{Lorem Ipsum}\par
\textls{Lorem Ipsum}\par
\textls{\textsc{Lorem Ipsum}}\par
\end{document}

The workaround (!) for this problem is to set Renderer=Basic.** If you uncomment the respective line in my example, you'll find the small caps properly letterspaced. However, globally putting the Renderer to Basic mode may cause problems in other places, as it seems to disable some OpenType features (the whole Renderer thing doesn't seem to be documented that well in the fontspec doc, but I can elaborate on that if you're interested). In earlier versions of fontspec, what I did was this:

(ex. 2)

\documentclass{article}
\usepackage{fontspec,microtype}
\setmainfont[SmallCapsFeatures={Renderer=Basic}]{Minion Pro}
\begin{document}
\textsc{Lorem Ipsum}\par
\textls{Lorem Ipsum}\par
\textls{\textsc{Lorem Ipsum}}\par
\end{document}

…which would put the Renderer to Basic mode for small capitals only, leaving it on Full everywhere else — a workaround I was pretty happy with. Unfortunately, this became impossible in more recent versions of fontspec. We can still use the Renderer key (as in example 1), but not as an option for a specific font style:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LaTeX error: "keys/key-unknown"
! The key 'fontspec/Renderer' is unknown and is being ignored.
! See the LaTeX3 documentation for further information.
! For immediate help type H <return>.
!...............................................

What I'd like to know, basically, is if there's an alternative way of selecting Basic mode for small caps only, or what other ways you guys would suggest to make small caps and microtype's letterspacing work together again — other than redefining the small caps commands to include Renderer=Basic, which doesn't seem all-too elegant to me:

\textls{\textsc{\addfontfeatures{Renderer=Basic}Lorem Ipsum}}

* This is LuaTeX, Version beta-0.70.1-2011082320 (rev 4277)
fontspec.sty 2011/09/13 v2.2 Advanced font selection for XeLaTeX/LuaLaTeX
luaotfload.sty 2011/04/21 v1.25 OpenType layout system
microtype.sty 2011/08/18 v2.5 Micro-typographical refinements (RS)
** thanks to Hans and Ulrike for mentioning it, http://archive.contextgarden.net/message/20110615.105120.bf868745.en.html

Best Answer

I really have to apologise for the long delay on this answer. As you discovered this was an unintentional change made while a lot of the package was being re-implemented.

I've spent some time today looking into how this could be resolved; I'm not really sure what the best option is, so I've reverted the package to the old behaviour (not the old code, though note). I express doubts on this in that I'm not sure it's wise to select faces within a family that use different renderers, but it probably can't hurt in this case.

This will be fixed in v2.3 of fontspec.

Related Question