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

adds to much space between mathcal symbol and subscript #592

Open mennucc opened 2 years ago

mennucc commented 2 years ago

Description

enabling unicode-math adds to much space between mathcal symbol and subscript

info

Minimal example demonstrating the issue

\documentclass{article}
\usepackage[paperwidth=0.3in,paperheight=0.3in,top=1pt]{geometry}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
\begin{document}
\noindent
\(\symcal F_j\)
\end{document}

Further details

I am using texlive version 2021.20220204-1 as packaged in Ubuntu

results do not vary in a visible way by using LuaLaTeX instead of XeTeX

IMHO the spacing in the first two cases is excessive, while the last one is fine.

marcin-serwin commented 2 years ago

In the current version (0.8q with TeXLive 2022) the spacing is only excessive with Latin Modern.

\documentclass{article}

\usepackage{unicode-math}

\begin{document}
\setmathfont{latinmodern-math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{texgyrepagella-math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{STIXTwoMath-Regular.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{Asana-Math.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{LibertinusMath-Regular.otf}
\[F_j\qquad \symcal F_j\]
\setmathfont{Garamond-Math.otf}
\[F_j\qquad \symcal F_j\]
\end{document}

image

e-kwsm commented 2 years ago

@marcin-serwin I guess you used LuaLeTeX since I can reproduce your result. XeLaTeX 3.141592653-2.6-0.999994 (TeX Live 2022) however gives excess spacing for STIXTwoMath as well:

xelatex

khaledhosny commented 3 months ago

This is an engine and/or font issue. For STIX Two Math, the script F has math kerning for positioning the subscripts but XeTeX is not applying it.

mennucc commented 3 months ago

I tried again my initial example with a more recent version of LuaLaTeX ( This is LuaHBTeX, Version 1.14.0 (TeX Live 2022/dev/Debian) and it looks fine image wheras with XeLaTeX it is horrible (This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2022/dev/Debian) image

If I use the standard font (and not Stix) then both xelatex and lulatex are horrible.

khaledhosny commented 2 months ago

FYI, there is a bug in the OpenType spec. LuaTeX is following the letter of the spec, which gives better results here (due to bad font data) while XeTeX is following the intent of the spec and matches Microsoft implementation.

I reported an issue against an OpenType spec, and eventually LuaTeX will need to be fixed as well as the fonts, so you should report your issue to the individual fonts that are not behaving as expected.

The issue here should be close since there is no much unicode-math can do here.