[XeTeX] question about ScriptPercentScaleDown
Jonathan Kew
jfkthame at gmail.com
Mon Oct 10 18:27:10 CEST 2016
On 10/10/2016 3:35 pm, Antonis Tsolomitis wrote:
>
> 2. Run xelatex on my example (set at 12pt). You will see in the output
> that the exponent is smaller than the
> base, although we have instructed in the Math table the engine/font
> to upscale the exponents to 120%
>
> 3. Now modify my attached file by removing the 12pt in the documentclass
> options.
> Re run xelatex. You will see that now the exponent scales properly
> and it is larger that the base.
>
> Could be a bug in the unicode-math package. I just do not know.
>
I'm pretty sure this is a bug in unicode-math (or more specifically,
perhaps, a failure of its interaction with the document class options).
There's code in unicode-math that is supposed to calculate the script
and scriptscript sizes using the percentages specified in the font
(exposed in xetex through \fontdimen10 and \fontdimen11 when an opentype
math font is loaded). But apparently when a non-10pt option is passed to
the document class, this is overriding unicode-math's computation and
loading the script and scriptscript fonts at default sizes provided from
somewhere else.
This isn't a xetex bug; the MATH-table values are correctly exposed
through the \fontdimen parameter, regardless of the size at which the
font is loaded. You can confirm this by adding some tracing to your example:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,12pt]{book}
\usepackage[no-math]{fontspec}
\usepackage{unicode-math}
\setmathfont{Asana-Math.otf}
\begin{document}
$e^{\epsilon}$
% convert ScriptPercentScaleDown and ScriptScriptPercentScaleDown
% fontdimens to numbers, to see what scaling _should_ have been used
% for \scriptfont and \scriptscriptfont
\count255=\fontdimen10\textfont0 \showthe\count255
\count255=\fontdimen11\textfont0 \showthe\count255
% confirm that these fontdimens are not affected by font size
\font\test="Asana Math:script=math" at 10pt
\count255=\fontdimen10\test \showthe\count255
\count255=\fontdimen11\test \showthe\count255
\font\test="Asana Math:script=math" at 12pt
\count255=\fontdimen10\test \showthe\count255
\count255=\fontdimen11\test \showthe\count255
% see what unicode-math has decided to load
\showthe\textfont0
\showthe\scriptfont0
\showthe\scriptscriptfont0
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
When running this with (unmodified) Asana Math, for example, the values
of \fontdimen10 and \fontdimen11 are 73 and 60 (percent) in all cases,
whether they're coming from \textfont0 (with any size option on the
documentclass) or from the explicitly-loaded \test font at any size. But
the final three \showthe commands will confirm that only with the 10pt
option (or no size option) has this scaling actually been used; with
either the 11pt or 12pt options, we get 8pt and 6pt for the script and
scriptscript fonts respectively.
I think you should report this as an issue for the unicode-math package.
It probably needs to take some additional steps to ensure that its
computed sizes override what the document class (or latex kernel) is doing.
JK
More information about the XeTeX
mailing list