7

As is known, luatex requires the fontspec option Renderer = Basic in order to display small caps when microtype's tracking = true is used.

\documentclass{article}
\usepackage[tracking = true]{microtype}
\usepackage{fontspec}
\setmainfont{Libertine Serif}[%
    SmallCapsFeatures = {%
%       Renderer = Basic, % breaks kerning, but allows small caps
        Letters = SmallCaps}]
\begin{document}
\textsc{ipa}
\end{document}

enter image description here

With Renderer = Basic, however, proper kerning between the characters P and A is removed:

enter image description here

@KhaledHosny tells me that this is because "Libertine uses class based kerning, which does not seem to be supported by the base mode of luaotfload". I'm curious to find out if there's a way to work around this problem?

The following screen capture from FontForge shows that there's supposed to be a -25 kerning between small caps P and A (click on the picture for a full size version).

enter image description here

As a test, I've tried to increase the kerning from -25 to -80, but the output with luatex is unchanged.

  • Is a kern defined between small caps p and a to begin with? – egreg Aug 24 '15 at 9:46
  • 1
    @egreg Yes. One second, and I'll add a (unfortunately huge) screen capture. – Sverre Aug 24 '15 at 9:51
  • Might "Libertine Serif" also be called "Linux Libertine O"? Or is it an entirely different font? – Mico Aug 24 '15 at 17:26
  • @Mico libertine is a fork of linux libertine provided by @KhaledHosny – Sverre Aug 24 '15 at 17:29
10

You can use the LetterSpace option in fontspec. It preserves kerning as you can see if you compare it with the output of Renderer=basic:

\documentclass{article}
\usepackage{microtype}
\usepackage{fontspec}
\setmainfont{LinLibertine_R}[%
    Extension = .otf,
    SmallCapsFeatures = {%
    LetterSpace = 10,
    Letters = SmallCaps}]
\setsansfont{LinLibertine_R}[%
    Extension = .otf,
    SmallCapsFeatures = {%
    LetterSpace = 10,
    Renderer = Basic,
    Letters = SmallCaps}]    
\begin{document}
\textsc{ipav} \par \sffamily \textsc{ipav}
\end{document}

enter image description here

  • 1
    While the letterspace value in microtype is given in thousandths of 1em (see the manual under 3.4), the letterspace value in luaotfload is given as a percentage of the font size (see the manual under 4.1). That can be a source of confusion. So if I understand it correctly letterspace = 100 in microtype should be identical to letterspace = 10 in luaotfload. – Sverre Aug 24 '15 at 12:19
  • It turns out that it's sufficient to use fontspec's LetterSpace option, and this works for both lualatex and xelatex. So I've edited your answer accordingly, if you don't mind. – Sverre Aug 25 '15 at 21:01
  • Letterspace is not the same than kerning. Letterspace uses the same spacing for all letters, on the other hand kerning uses the best spacing for every pair of letters. – skan Nov 3 '17 at 16:41
  • @skan: that's exactly what my example shows: the letterspacing between all letters and the kerning between AV. – Ulrike Fischer Nov 3 '17 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.