latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
239 stars 28 forks source link

Strange behavior with math kern #504

Open YuanshengZhao opened 5 years ago

YuanshengZhao commented 5 years ago

Description

Check/indicate

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: image with LuaTeX: image

For the first point, the expected behavior should be: (MS Word) image

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

stone-zeng commented 5 years ago

@khaledhosny @behdad

e-kwsm commented 2 years ago

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}

xelatex False xelatex True lualatex False lualatex True