The correction height calculated seems to be incorrect. I do not know the exact value it actually gets, but from its behavior, chances are that the two heights are both incorrect. XeTeX and LuaTeX have different behavior, but none is expected.
If one glyph (say, j) has top left math kern, then x_j will be kerned on XeTeX but not LuaTeX, and x_{jj} will be kerned by LuaTeX but not XeTeX. This is somewhat inconsistent. If the base glyph (say, V) has bottom right kern, then similar behaviors happens for V_x and V_{xy}: LuaTeX will not kern V_x.
Check/indicate
[x] Relevant for XeTeX
[x] Relevant for LuaTeX
[ ] Issue tracker has been searched for similar issues?
[ ] Links to discussion if appropriate
Minimal example demonstrating the issue
\documentclass[fleqn]{article}
\usepackage{unicode-math}
\begin{document}
//This illustrates the first point
\setmathfont{Cambria Math}
\[V_\symbol{9146}\]
\[V_\symbol{9147}\]
//This illustrates the second point
\setmathfont{foo}
//Some font with top left math kern, here I give j a positive kern,
//meaning that if kerned, j will become farther away from the base glyph
\[x_j\]
\[x_{jj}\]
\end{document}
with XeTeX:
with LuaTeX:
For the first point, the expected behavior should be:
(MS Word)
I do not know what behavior is desired for the second point.
Description
correction height
calculated seems to be incorrect. I do not know the exact value it actually gets, but from its behavior, chances are that the two heights are both incorrect. XeTeX and LuaTeX have different behavior, but none is expected.j
) has top left math kern, thenx_j
will be kerned on XeTeX but not LuaTeX, andx_{jj}
will be kerned by LuaTeX but not XeTeX. This is somewhat inconsistent. If the base glyph (say,V
) has bottom right kern, then similar behaviors happens forV_x
andV_{xy}
: LuaTeX will not kernV_x
.Check/indicate
Minimal example demonstrating the issue
with XeTeX:
with LuaTeX:
![image](https://user-images.githubusercontent.com/37881856/50425598-e8422180-08bd-11e9-8773-3fa3fec2eafb.png)
For the first point, the expected behavior should be: (MS Word)![image](https://user-images.githubusercontent.com/37881856/50425613-4111ba00-08be-11e9-9017-b6fd125a5517.png)
I do not know what behavior is desired for the second point.
Further details
For some old version, the behavior with math kern was different: https://tex.stackexchange.com/questions/24261/weird-font-spacing-issue-with-luatex-asana-math Another post that may be related: https://tex.stackexchange.com/questions/312098/luatex-0-95-incorrect-math-kerning This contains the explanation of
correction height
, by MS: https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathitalicscorrectioninfo-table