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

Character selection in scriptsize #627

Closed projekter closed 6 months ago

projekter commented 6 months ago

Description

I'm using the NewCMMath font, which provides a calligraphic and a script alphabet. The latter can be activated by choosing StylisticSet=1. However, the font does (currently) not provide glyphs for the \scriptsize and \scriptscriptsize versions of the script alphabet. As a consequence, even when StylisticSet=1 is activated, as soon as the size changes, the characters also change shape.

The font author writes

But unicode-math should see that the font does not provide these characters and scale the regular size when ss01 is selected. Instead, it forces the scriptstyle characters even if it has to draw them from the default calligraphic.

Can the glyph selection process be adapted to deal with such a situation as the user would expect? This issue is kind of the opposite to https://github.com/wspr/unicode-math/issues/484, as here, XeTeX does the job correctly, only LuaTeX fails.

Add info or delete as appropriate:

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{fontspec,unicode-math}
\setmathfont{NewCMMath-Regular.otf}[StylisticSet=1]
\begin{document}
   \[
     \displaystyle\symcal A \textstyle\symcal A \scriptstyle\symcal A \scriptscriptstyle\symcal A
   \]
\end{document}
projekter commented 6 months ago

unicode-math seems to be innocent, this is the following bug: https://github.com/latex3/luaotfload/issues/266. With the fix to the fontloader posted there, this is resolved even if the font does not provide the characters explictly; and if it does, it also selects them correctly.