latex3 / unicode-math

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

unicode-math resets the renderer for fonts defined with NFSSfamily #565

Open u-fischer opened 3 years ago

u-fischer commented 3 years ago

Description

unicode-math creates math alphabets from the text fonts. Normally this create a new family XXX(1), but if the text font used the NFSSFamily key, unicode math defines the same family, and as it changes the Renderer to Basic actually can overwrite the Renderer of the text font. Imho it would be better if unicode math would always force a new family name.

Add info or delete as appropriate:

Minimal example demonstrating the issue

The example demonstrates the problem with the harfbuzz renderer, some accents are placed better with this renderer and so give a visual impression. But node mode is affected too. \defaultfontfeatures is used to get the right order.

\documentclass{article}
\usepackage{unicode-math}
\defaultfontfeatures{Renderer=Harfbuzz}

\setmainfont{texgyreheros-regular.otf}[NFSSFamily=tgheros]
\setsansfont{texgyreheros-regular.otf}%[NFSSFamily=tgheros]
\begin{document}

\'{ü}

\sffamily

\'{ü}

\end{document}

image