Skip to content

Spacing/Scaling of all elements is affected by later range-limited font set. #650

Open
@jcasc

Description

@jcasc

This is relevant to lualatex.

When I set a mathfont, and then replace only a certain range of characters with another range, some spacing/scaling rules of this second font are used for the entire document, even when this does not contain any characters of this range. Please consider this MWE:

\documentclass{article}

\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Noto Sans}

\setmathfont{Asana Math}
% \setmathfont{Tex Gyre Bonum Math}[range={bb}]
% \setmathfont{Asana Math}[range={}]

\begin{document}

$s = \left \lBrack \left ({\displaystyle \prod_{min}^{max}},\text{g}\right ) \right \rBrack_{\mathup{m}}$


$s = \left \lBrack \left (i,\text{g}\right ) \right \rBrack_{\mathup{m}}$

\end{document}

Produces:

Image

Uncommenting the first commented line (note how the range does not occur anywhere in the document, so it should, in theory not affect any character) produces:

Image

in which the size of the double-struck brackets is differnt in the second line, as is the position of the subscripts and superscripts on the product and the right bracket.

Uncommenting the 2nd comment line produces the first image again, suggesting that some spacing/scaling rules of whatever font was last set is in effect, even when all characters belong to a different font.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions