2

I’ve been playing around with microtype’s protusion-capabilities and LuaLaTeX, but faced a problem regarding old-style superscript numbers. The regular numbers protrude. This code

\documentclass{scrbook}

\usepackage{fontspec}
\usepackage[protrusion=true,final]{microtype}
\usepackage{libertinus}
\usepackage{blindtext}


\SetProtrusion{encoding={*}}
    {1={ ,1000},2={ ,1000},3={ ,500},4={ ,500},5={ ,500},
     6={ ,1000},7={ ,1000},8={ ,1000},9={ ,500},0={ ,500}}

\begin{document}
\setcounter{footnote}{100}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi,
nec ante. Donec, ullamcorper, felis non sodales commodo, lectus velit ultrices
augue, a dignissim nib lectus placerat pede.\footnote{\blindtext} Vivamus nunc nunc, molestie
\end{document}

yields this:

enter image description here

(value 1000 is set for the sake of clarity; it’s a bit too large). However, if I change the option to old-style numbers

\usepackage[osf]{libertinus}

they don’t protrude anymore. (They do with pdfLaTeX, though.)

enter image description here

Is it possible to change that?

2
  • 1
    You need to reference the oldstyle numbers by glyph name: \SetProtrusion{encoding={TU},family=LibertinusSerif}{/one.oldstyle={,1000}}.
    – Robert
    Jan 22 at 14:55
  • @Robert : That did the trick. I looked up the specific glyph in the font-file, and it was referenced as one.taboldstyle.
    – Kubo
    Jan 22 at 15:34

1 Answer 1

2

microtype in combination with LuaTeX (and XeTeX) is able to reference font-specific glyph-names with the prefix »/«. The case described in the documentation is the ligature »fl« which can be addressed with »/f_l«

In the case of oldstyle-number for »1«, this is done by

\SetProtrusion{encoding={TU},family=LibertinusSerif}{/one.taboldstyle={,1000}}

This yields:

enter image description here

The font-specific glyph-names can be retrieved e.g. by searching the font-file with FontForge:

enter image description here

The solution was provided by Robert in a comment.

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.