# [XeTeX] Several apostrophe-related problems (kerning, mapping)

Pierre Morel pier.morel at gmail.com
Sun Oct 31 16:02:01 CET 2010

Hello,

My thesis is finished soon, but I have an annoying apostrophe problem.

In French we have a lot of apostrophes uses like this : L'œil, l'incertitude, etc.
In theory, these apostrophes should be the unicode character U+2019 (right single quotation mark) instead of a straight apostrophe (U+0027). This replacement is automatically made by this command : \defaultfontfeatures{Mapping=tex-text}

First there is a problem with the kerning of this U+2019 character, it is possibly a bug in the font I'm using (Adobe Caslon Pro), but I'd like to solve it anyway.
Here is an example (The word L'œil, on the top right) :
http://dl.dropbox.com/u/1205127/Images/xetex.jpg
The apostrophe is completely kerned above the "œ" (the same problem is present for any small character), which thus touches the "L".
So my first question is: is there a way to override the default kerning of this U+2019 character so that it behaves in a more correct way (with a slight space between the apostrophe and the next letter) ?

Now there is a second problem (which solved the first one but in a bad way).
When activating margin kerning, xetex behaves as if the line \defaultfontfeatures{Mapping=tex-text} was not present : U+0027 apostrophes stay straight (which curiously solves the kerning problem, see the example on the top left of the image), and  and '' are not converted appropriately (more annoying).
Here is what I use for the margin kerning (when I comment these line, the mapping problem is corrected) :

\newcount\countA
\ifx\XeTeXprotrudechars\undefined
\pdfprotrudechars=2
\else
\let\pdftexversion=\countA
\pdftexversion = 140
\XeTeXprotrudechars=2%\fi
\input protcode-native
\font\f="Adobe Caslon Pro" at 11pt \f
\setprotcode\f
\pretolerance=-1
\tolerance=9999
\emergencystretch=2em

With the file protcode-native file being

\def\setprotcode#1{
\rpcode#1 U"0021    55
\rpcode#1 U"002C    194
\rpcode#1 U"002D    233
\rpcode#1 U"002E    194
\rpcode#1 U"003B    138
\rpcode#1 U"003A    138
\rpcode#1 U"003F    94
\lpcode#1 U"2018    194
\rpcode#1 U"2019    194
\rpcode#1 U"0027    194
\lpcode#1 U"201C    250
\rpcode#1 U"201D    250
\rpcode#1 U"2013    150
\rpcode#1 U"2014    200
}

So, in short, I want to use margin kerning while maintaining the tex-text mapping AND having a correct kerning with the U+2019 apostrophe.

PS: (this last problem also appears on my sans serif font (Myriad pro), an example is visible in the linked image.

Thank you,

Pierre


More information about the XeTeX mailing list