# XeLaTeX: Letterspacing with swashes

I'm trying to use XeLaTeX to typeset a word in EB Garamond, and I want only two of the letters in the word to have swashes. However, the swashed characters screw up the letterspacing:

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont[LetterSpace=40]{EB Garamond}
\begin{document}
% No swashes, correct letterspacing:
\emph{ANAGRAMME.}

% Two swashes, incorrect letterspacing:
\end{document}


How can I make the letterspacing consistent around the swashed glyphs?

• Letter spacing doesn't work across font changes. – egreg Oct 26 '14 at 21:29
• It is notable that this is possible with pdfTeX if the fonts are set up appropriately to support it. That is, if swashes are realised as ligatures, you can use the letter spacing facilities of microtype to do this because no font change is required. [There is a price in terms of control when you switch from traditional TeX fonts to the use of system fonts.] – cfr Oct 26 '14 at 21:51

Letter spacing can't work across font changes. You have to emulate it with an explicit kern. Since the font is at 12pt, LetterSpacing=40 corresponds to adding a 4.8pt kern between letters.

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont[LetterSpace=40]{EB Garamond}
\begin{document}
% No swashes
\emph{ANAGRAMME}

% Two swashes

• @Psychonaut <letter spacing factor> * <font size>/10 – egreg Oct 27 '14 at 7:43
• I didn’t try this example until today, so I don’t know how TeX Live 2014 behaved, but at least in 2015, luatex seems to get letterspacing right across these font changes. That’s surprising but very welcome! xetex, which the OP asked about, still needs the explicit kerns. – Thérèse Aug 20 '15 at 15:29