# Is there a good workaround for the fact that when using fontspec to do fake slant and small-caps-by-scaling the small caps will also be fake slanted?

Fake slant does not play nice together with using scale for doing fake small caps with fontspec. There seems to be some kind of definition leakage in fontspec meaning that when I specify both SmallCapsFeature and SlantedFeatures my \scshape text also receives the slant. Expected behavior is that \textsc{FOO} should be small but straight and \textsl{FOO} should slanted. However, as shown in the examples below that is not the case, instead the \textsc{FOO} is both small and slanted.

\documentclass{memoir}

\usepackage{fontspec}

\begin{document}
\setmainfont[
SmallCapsFont={Linux Libertine O},
SmallCapsFeatures={Scale=0.5},
SlantedFont={Linux Libertine O},
SlantedFeatures={FakeSlant=0.5},
]{Latin Modern Roman}

Small Caps is slanted now: \textsc{FOO} and also slanted is slanted: \textsl{FOO}

\end{document}


• Seems like a bug in fontspec. – egreg Feb 18 '15 at 16:25
• @egreg: yea :( Is it possible to work around it somehow you think? – jonalv Feb 18 '15 at 16:27
• I had to see @egreg's answer to understand the issue here. Could you be more specific in both your question title and question body about what the problem is, rather than saying it doesn't "play nice"? This site is not only for solving our own immediate problems, but also to serve as a resource for future visitors experiencing the same problems as we have now. – Sverre Feb 18 '15 at 16:41
• @Sverre: Is that better? If not, "Patches welcome!" :) – jonalv Feb 19 '15 at 9:09
• Definitely a bug, sorry. Will attempt to address soonish. One comment: the manual isn't very clear on this, but SmallCapsFont/Features should normally be nested inside SlantedFeatures={...}. Not that that fixes your problem! – Will Robertson Feb 19 '15 at 10:48

It seems like a bug in fontspec; you can cure it by specifying FakeSlant=0 for the small caps font.

\setmainfont{Latin Modern Roman}[
SmallCapsFont={Linux Libertine O},
SmallCapsFeatures={Scale=0.5,FakeSlant=0},
SlantedFont={Linux Libertine O},
SlantedFeatures={FakeSlant=0.5},
]


Note that I used the most recent version of fontspec, where the options are specified after the font name.

• Wow, that's brilliant, and so easy! How do you come up with all these things? :) – jonalv Feb 18 '15 at 16:31
• @jonalv Browsing the manual (not this time, but in the past) and applying some fantasy. ;-) – egreg Feb 18 '15 at 16:45
• Hmm, definitely a bug. Without looking at the code, I suspect a variable scoping problem. – Will Robertson Feb 19 '15 at 10:46