1

Consider the following MWE:

\documentclass[varwidth]{standalone}
\usepackage{ifluatex}
\usepackage{ifxetex}
\usepackage{metalogo}
\usepackage{fontspec}

\setmainfont{Bembo}[BoldFont = Bembo Bold]
\newfontface\bembo{Bembo}
\newfontface\bembobold{Bembo Bold}
\newfontface\bemboboldos{Bembo Bold Oldstyle Figures}

\makeatletter
\newcommand{\showfont}{\f@family{}}

\makeatother

\begin{document}
\ifxetex
\XeLaTeX
\fi
\ifluatex
\LuaLaTeX
\fi


\textbf{AVATAR 48} \showfont{}\\
\bembo       AVATAR 48 \showfont{}\\
\bembobold   AVATAR 48 \showfont{}\\
\bemboboldos AVATAR 48 \showfont{}

\end{document}

And the following output generated with XeLaTeX and LuaLaTeX, respectively:

XeLaTex rendering of 'AVATATR' with broken kerning. LuaLaTex  rendering of 'AVATAR' in the same font with correct kerning.

Note that XeLaTeX does not use kerning when setting in the "Bembo Bold" font in the 2nd line (where the font is selected using \setmainfont and the font face is selected with \textbf), but in the 4th line, where the font is loaded using \newfontface. Also, LuaLaTeX always kerns correctly.

Why is that?

closed as off-topic by TeXnician, Stefan Pinnow, Zarko, user36296, Bobyandbob Sep 30 '18 at 19:02

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 8
    The implementation of the font handling is entirely different, implemented in lua in one case and using the harfbuzz library in the other, so the surprising thing is how often they do the same thing, not that sometimes they differ – David Carlisle Sep 24 '15 at 15:40
  • Ok, that explains the difference between LuaLaTex and XeLaTeX. But why kerns XeLaTeX differently when using \textbf and using the bold font face loaded directly? – bev Sep 24 '15 at 16:00
  • @DavidCarlisle Make that an answer? – Joseph Wright Dec 3 '16 at 21:29
  • 4
    I'm voting to close this question as answered in the comments. – TeXnician Sep 30 '18 at 16:50