Let's try simplifying the example.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\begin{document}
\addfontfeatures{LetterSpace=30.0}
AB CD EF
\showoutput
\end{document}
This is the relevant part from the log file when compiling with LuaLaTeX:
....\hbox(0.0+0.0)x15.0, direction TLT
....\EU2/LatinModernRoman(1)/m/n/10 A
....\kern 3.0
....\EU2/LatinModernRoman(1)/m/n/10 B
....\glue 3.33 plus 1.66331 minus 1.1111
....\EU2/LatinModernRoman(1)/m/n/10 C
....\kern 3.0
....\EU2/LatinModernRoman(1)/m/n/10 D
....\glue 3.33 plus 1.66331 minus 1.1111
....\EU2/LatinModernRoman(1)/m/n/10 E
....\kern 3.0
....\EU2/LatinModernRoman(1)/m/n/10 F
and here's the same when XeLaTeX is used:
....\hbox(0.0+0.0)x15.0
....\EU1/LatinModernRoman(1)/m/n/10 AB
....\glue 6.33 plus 3.16182 minus 2.1121
....\EU1/LatinModernRoman(1)/m/n/10 CD
....\glue 6.33 plus 3.16182 minus 2.1121
....\EU1/LatinModernRoman(1)/m/n/10 EF
The model used for representing letter spacing is different, so XeTeX doesn't show the interletter kerns. However, this shows where LuaLaTeX (or more probably luaotfload
) goes wrong: in XeTeX also the interword space is multiplied by the spacing factor, which it isn't in LuaTeX.
Between the two letter groups we have
....\glue 3.33 plus 1.66331 minus 1.1111
in LuaTeX, while it is
....\glue 6.33 plus 3.16182 minus 2.1121
If I remove the \addfontfeatures
line, the glue is the same in both engines.
If I change the font to Times New Roman, I get
....\glue 2.5 plus 1.24875 minus 0.83415
in LuaTeX (just like when LetterSpace
is not added), but
....\glue 5.5 plus 2.74724 minus 1.83516
in XeTeX.
To make the bug clear: in XeTeX the amount of letter spacing is also added to the interword space, but this is not done in LuaTeX.
My suggestion is to use microtype
letter spacing in LuaLaTeX:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{microtype}
\begin{document}
\textls[400]{AB CD EF}
\showoutput
\end{document}
produces
....\EU2/TimesNewRoman(0)/m/n/10/400ls A
....\EU2/TimesNewRoman(0)/m/n/10/400ls B
....\glue 3.5 plus 1.24875 minus 0.83415
....\EU2/TimesNewRoman(0)/m/n/10/400ls C
....\EU2/TimesNewRoman(0)/m/n/10/400ls D
....\glue 3.5 plus 1.24875 minus 0.83415
....\EU2/TimesNewRoman(0)/m/n/10/400ls E
....\EU2/TimesNewRoman(0)/m/n/10/400ls F
which is comparable to the XeTeX output and the result is
Here is a plain TeX example:
\input ifluatex.sty
\ifluatex
\input luaotfload.sty
\font\test=LatinModernRoman:mode=node;script=latn;language=DFLT;+tlig;+trep;letterspace=30
\else
\font\test="Latin Modern Roman/OT:script=latn;language=DFLT;mapping=tex-text;letterspace=30"
\fi
\test
AB CD EF
\tracingoutput=1
\tracingonline=1
\showboxbreadth=\maxdimen
\showboxdepth=\maxdimen
\bye
If run with LuaTeX, the output shows
...\test A
...\kern 2.7
...\test B
...\glue 3.087 plus 1.54195 minus 1.03003
...\test C
...\kern 2.7
...\test D
...\glue 3.087 plus 1.54195 minus 1.03003
...\test E
...\kern 2.7
...\test F
If run with XeTeX, it shows
...\test AB
...\glue 6.33 plus 3.16182 minus 2.1121
...\test CD
...\glue 6.33 plus 3.16182 minus 2.1121
...\test EF
so the problem is not due to interaction with LaTeX. If the letterspace
bit is removed, the interword glue turns out to be 3.087pt
with LuaTeX and 3.33pt
with XeTeX.
fontspec
in installed on your system? The reason I ask is that on my system -- MacTeX2015, LuaTeX 0.80.0, XeTeX 3.14159265-2.6-0.99992, fontspec 2.4e -- the outcome is the same when I compile your MWE under LuaLaTeX and XeLaTeX; what I get corresponds to the first of the two screenshots you've posted.SmallCapsFeatures={Renderer=Basic}
, use something likeSmallCapsFeatures={LetterSpace=5}
. There’s no need forRenderer=Basic
here.LetterSpace
is broken in LuaTeX.