Hello,

While testing the STIX Two Math font, I tried to emulate the cramped
style by issuing a non-existing radical (see, for instance, mathtools
for TFM-based fonts and unicode-math for OpenType fonts). There is a
problem when emulating the cramped display style.

% plain XeTeX
\def\tmp#1{\textfont#1\tenmi \scriptfont#1\sevenmi
 \scriptscriptfont#1\fivemi}
\font\tenmi="[STIXTwoMath-Regular.otf]:script=math" at 10pt
\font\sevenmi="[STIXTwoMath-Regular.otf]:script=math;+ssty=0" at 7pt
\font\fivemi="[STIXTwoMath-Regular.otf]:script=math;+ssty=1" at 5.5pt
\tmp0\tmp1\tmp2\tmp3%
\catcode`\@=11
% deal with cramped styles (i.e., lowered superscripts)
\newbox\cr@mpedbox
\def\setcr@mped#1#2#3{% #1: one of four math styles
% #2: one of three math fonts
% #3: math content to be cramped
 \setbox\cr@mpedbox\hbox{$#1\kern-\nulldelimiterspace
  \Uradical255 0 {#3}\m@th$}% force cramped via non-existing radical
 \ht\cr@mpedbox=\dimexpr\ht\cr@mpedbox
  -\fontdimen\ifx#1\displaystyle60 \else59 \fi#22\relax}% RadicalVGap
\def\int{\Umathchar1 3 "222B \nolimits}
\def\test#1#2#3{\setbox\z@\hbox{$#1#3\m@th$}%
 \setcr@mped#1#2{#3}%
 \immediate\write-1{\string#1: \the\ht\z@, \the\ht\cr@mpedbox.}}
\test\displaystyle\textfont E%
\test\textstyle\textfont E%
\test\scriptstyle\scriptfont E%
\test\scriptscriptstyle\scriptscriptfont E%
\test\displaystyle\textfont\int
\test\textstyle\textfont\int
\test\scriptstyle\scriptfont\int
\test\scriptscriptstyle\scriptscriptfont\int
\bye

leaves

\displaystyle: 6.57pt, 6.75pt.
\textstyle: 6.57pt, 6.56999pt.
\scriptstyle: 4.921pt, 4.92099pt.
\scriptscriptstyle: 4.02051pt, 4.0205pt.
\displaystyle: 14.31pt, 14.48999pt.
\textstyle: 7.345pt, 7.34499pt.
\scriptstyle: 5.35849pt, 5.35847pt.
\scriptscriptstyle: 4.433pt, 4.43298pt.

in the log. Every style but \displaystyle is off by 1sp, which is
negligible. But \displaystyle is consistently off by 0.18pt (18
thousandths of the em).

Running

\begingroup\let\e\expandafter
\def\showfontdimen#1{\ifnum#1<66
 \immediate\write-1{#1: \the\fontdimen#1\textfont2}%
 \e\showfontdimen\e{\the\numexpr#1+1\e}\fi}
\showfontdimen1\endgroup

shows that no font dimensions equal 1.88pt (Technically, \fontdimen 9,
10, 11, and 65 are percentages in sp units). What is going on?

Regards,
Rex

Reply via email to