unicode-math
unicode-math copied to clipboard
Strange behavior with math kern
Description
- 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, 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
- [x] Relevant for XeTeX
- [x] Relevant for LuaTeX
- [ ] Issue tracker has been searched for similar issues?
- [ ] Links to <tex.stackexchange.com> 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.
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
@khaledhosny @behdad
Perhaps related, kerning (LuaLaTeX only) and vertical position of \bar
are strange:
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$P\bar{4}2m$
\end{document}
- LuaHBTeX, Version 1.13.2 (TeX Live 2021)
- XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021)
- unicode-math 2020/01/31 v0.8q