# Problem with kerning using LuaLaTeX

I am having a problem with kerning while using LuaLaTeX. In my example, the pair “AT” does not render well. This is clear by comparing LuaLaTeX output with XeLaTeX's, which from the same code renders the pair correctly. In this image, LuaLaTeX output is on the left:

With small caps the problem seems to appear only when I put them inside an \mbox, as shown in the last line of my example. (Could this be related to hyphenation, perhaps? Words protected from hyphenation are rendered with good kerning.)

I have been trying to pinpoint the source of the problem, but I am clueless. (I am new to LaTeX.)

My system is equipped with TeX Live 2011, just installed with as few packages as I could.

The code used:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Minion Pro}

\begin{document}

\mbox{}\newline
\huge FOUNDATIONS\newline
\huge \textsc{foundations}\newline
\huge \textsc{\mbox{foundations}}

\end{document}

-
It seems that the problem has something to do with the processing mode in luaotfload. If I select base, the kerning problem gets extended to the second line (with the first one then rendering right). However, explicitly setting node mode (even though it is used by default) does not solve the problem. It appears as if the processing mode were being changed for whatever reason at different points in the document. –  Mendle Jan 15 '12 at 0:58

Things like this are very difficult to debug. The problem is that there exists a lot of potential sources for the problem: The engine luatex, the lua code used to load and manipulate the font (here luaotfload based on code from context), the mode used (base or node) and naturally the font.

I can see the different kernings In the following example the kerning between A + T are missing at hyphenation points when mode=node is used. "ATT" is fine, and mode=base too.

\documentclass{article}