[XeTeX] Scaling fonts in fontspec changes the relative gap in 100 °C when using siunitx

Tobias Schoel liesdiedatei at googlemail.com
Thu Nov 24 15:34:46 CET 2011



Am 24.11.2011 16:18, schrieb Joseph Wright:
> On 24/11/2011 13:56, Tobias Schoel wrote:
>> Hi,
>>
>> consider this minimal example:
>>
>> \documentclass{minimal}
>>
>> \newcommand{\phont}{Asana Math}
>> \newcommand{\Phont}{TeX Gyre Pagella}
>>
>> \usepackage{fontspec}
>> \setmainfont{\Phont}
>> \usepackage{unicode-math}
>> \setmathfont{\phont}
>>
>> \usepackage{siunitx}
>> \sisetup{%
>> math-celsius=℃,
>> text-celsius=℃,
>> detect-all
>> }
>>
>> \begin{document}
>> \setmainfont[Scale=1]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=2]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=3]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=4]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=5]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=6]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=7]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=8]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=9]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=10]{\Phont}
>> \SI{100}{\celsius}
>>
>> \clearpage
>> \renewcommand{\Phont}{TeX Gyre Pagella Bold}
>>
>> \setmainfont[Scale=1]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=2]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=3]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=4]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=5]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=6]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=7]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=8]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=9]{\Phont}
>> \SI{100}{\celsius}
>>
>> \setmainfont[Scale=10]{\Phont}
>> \SI{100}{\celsius}
>>
>> \clearpage
>>
>> \setmathfont[Scale=1]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=2]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=3]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=4]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=5]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=6]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=7]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=8]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=9]{\phont}
>> \(\SI{100}{\celsius}\)
>>
>> \setmathfont[Scale=10]{\phont}
>> \(\SI{100}{\celsius}\)
>> \end{document}
>>
>> When scaling the fonts, it seems to me, that the gap between 100 and °C
>> (actually its ℃=u2103), which some fonts don't have but TeX Gyre Pagella
>> and Asana Math do, gets smaller in relation to the overall size.
>>
>> What is the reason for this?
>>
>> bye
>>
>> Toscho
>>
>
> The 'gap' here is the product marker for multiplication of the value by
> the unit. This is by default a thin space, and is always set in math
> mode using the current siunitx approach. You can force the use of the
> text mode font with
>
>    \sisetup{number-unit-product = \text{\,}}
Yes, that helps. I have now also seen, that siunitx got updated to 2.4, 
which deals with the problem of "minus" I issued at bitbuckt.

>
> Now, the reason that this is in math mode is because I was aiming at the
> case where products are actually shown as such, using \cdot or \times.
> It seemed (when I initially wrote siunitx) that forcing math mode here
> was the most sensible approach.
>
> In siunitx v2.4 (current release), I dropped several of these 'always
> math' ideas, and am currently seeing what feedback I get on this. *If*
> this seems acceptable to users, I may alter the behaviour of the
> 'product-like' options to also require \ensuremath to guarantee math
> mode for symbols. This would be a breaking change, and so I feel it is
> best to first see how the changes in v2.4 work in practice.
I'm not sure about the defaults either, but if I say "mode=text" or 
"detect-mode" & use \SI in text-mode, then I don't want any 
tex-math-mode to fiddle around in the output. That often confused me in 
the last time. I will try with 2.4.

Thanks

Toscho


More information about the XeTeX mailing list