3

I know there are plenty of questions about it but after way too much searching I couldn't find a working fix. Some only work with lualatex, some with \usepackage{MinionPro}, some don't even compile...

Is there a way to fix the ugly apostrophe kerning with Minion Pro and xelatex? It's way too tight and completely wrong for Italian typographic styles. Minion is used extensively, I'm pretty sure I've seen it in several latex-produced-looking Italian documents, so there must be a solution. I'm about to abandon it and go back to the trustworthy Computer Modern where I didn't have to deal with this stuff.

Here's a mwe with an apostrophe rich paragraph, compile it with xelatex.

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{italian}
\usepackage{csquotes}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Minion Pro}

\begin{document}
C'era un'oca con l'ala sinistra fratturata. L'altra ala era anch'essa
malmessa dopo l'estrema fatica del viaggio
d'oltreoceano. Per un po' poteva resistere ma un'operazione era
senz'altro consigliata.
\end{document}

and the same with Computer Modern

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage[babel]{csquotes}

\begin{document}
C'era un'oca con l'ala sinistra fratturata. L'altra ala era anch'essa
malmessa dopo l'estrema fatica del viaggio
d'oltreoceano. Per un po' poteva resistere ma un'operazione era
senz'altro consigliata.
\end{document}

And the results, xelatex + Minion (see e.g. n'o which has no spacing at all) xelatex+minion pro

and, much better, pdflatex + CM pdflatex+cm

2

1 Answer 1

3

It is actually not that hacky. Try the following (to be typeset with XeLaTeX):

\documentclass{minimal}

\usepackage{fontspec}

\setmainfont[Ligatures=TeX]{Minion Pro}

\makeatletter
\XeTeXinterchartokenstate=1

\newXeTeXintercharclass\LetterClass
\@tempcnta=`\A
\loop\unless\ifnum\@tempcnta>`\Z
  \XeTeXcharclass \@tempcnta \LetterClass
  \advance \@tempcnta by 1
\repeat
\@tempcnta=`\a
\loop\unless\ifnum\@tempcnta>`\z
  \XeTeXcharclass \@tempcnta \LetterClass
  \advance \@tempcnta by 1
\repeat

\newXeTeXintercharclass\ApostropheClass 
\XeTeXcharclass `’ \ApostropheClass
\XeTeXcharclass `' \ApostropheClass
\XeTeXinterchartoks \LetterClass \ApostropheClass = {\kern.1ex }
\XeTeXinterchartoks \ApostropheClass \LetterClass = {\kern.1ex }

\makeatother

\begin{document}

\begingroup\XeTeXinterchartokenstate=0 % Typeset without manual kerning
C'era un'oca con l'ala sinistra fratturata. L'altra ala era anch'essa
malmessa dopo l'estrema fatica del viaggio
d'oltreoceano. Per un po' poteva resistere ma un'operazione era
senz'altro consigliata.
\endgroup

C'era un'oca con l'ala sinistra fratturata. L'altra ala era anch'essa
malmessa dopo l'estrema fatica del viaggio
d'oltreoceano. Per un po' poteva resistere ma un'operazione era
senz'altro consigliata.

\end{document}

Minion Pro is known for its very small apostrophe kerning. LaTeX of course allows for manual kerning, but you want to kern certain glyph pairs every time they show up. Furthermore, you want to kern pairs like [every letter] [apostrophe].

So, we have to tell LaTeX what [every letter] shall be. This is done by assigning every letter from a to z and from A to Z to a certain charclass. An apostrophe is assigned to another charclass. Then, we tell LaTeX to add some kerning between these two classes.

The above code actually puts exactly this. As far as I know, you can only tell fontspec to generally increase or decrease kerning, but not for certain glyphs. If I read the other answers to similar problems on this platform, it seems to me that this is the most straightforward solution. Maybe someone else can provide a simpler one.

4
  • Thank you! way much clearer with your explanation, not sure if it is the best approach but it seems to work (need to carefully check it doesn't mess with other things). I'll keep the question open for a while in case other solutions come up.
    – filippo
    Jan 24, 2018 at 10:45
  • OK, found something else on the web: typophile.com/node/35308 . They obviously created a language definition (.ldf) file that contains the kerning information. You have to put it into your working directory and chose this “language”. But it actually seems as hacky as my approach and I didn’t check whether it really works. Jan 24, 2018 at 10:49
  • Interesting discussion, it looks like a similar approach, I like the xetex based one better though
    – filippo
    Jan 24, 2018 at 11:05
  • 1
    Just for completeness, I think only the post-apostrophe kerning is needed in italian and a lower value should be enough. \kern.01ex looks good to me, maybe even slightly less
    – filippo
    Jan 24, 2018 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .