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:

\setmainfont[LetterSpace=40]{EB Garamond}
% No swashes, correct letterspacing:

% Two swashes, incorrect letterspacing:

output of the example code

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

  • 2
    Letter spacing doesn't work across font changes.
    – egreg
    Oct 26, 2014 at 21:29
  • 2
    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, 2014 at 21:51

1 Answer 1


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.

\setmainfont[LetterSpace=40]{EB Garamond}
% No swashes

% Two swashes

enter image description here

  • Thanks! In my document I may need to do this with texts of various font sizes and letterspacing values. What's the formula for calculating the kerning in the general case?
    – Psychonaut
    Oct 27, 2014 at 6:02
  • 1
    @Psychonaut <letter spacing factor> * <font size>/10
    – egreg
    Oct 27, 2014 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, 2015 at 15:29

You must log in to answer this question.

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