stipub / stixfonts

OpenType Unicode fonts for Scientific, Technical, and Mathematical texts
SIL Open Font License 1.1
730 stars 41 forks source link

Inconsistent size changes for text and math fonts #87

Open davidmjones opened 7 years ago

davidmjones commented 7 years ago

Hi!

There's an inconsistency in changing sizes for math and text fonts (I'm using LuaLaTeX and unicode-math). The following code illustrates the problem. Note that if I put any size changing command like \small, \footnotesize etc. then math font becomes slightly larger than the corresponding text font.

\documentclass[a4paper,10pt]{article} \usepackage{amsmath} \usepackage{unicode-math} \setmathfont{STIX Two Math} \setmainfont{STIX Two Text} \begin{document} [ \left(\frac{x+y}{x-y}\right) \quad\text{Some text 0 $0x+y_x$.} ]

\small [ \left(\frac{x+y}{x-y}\right) \quad\text{Some text 0 $0x+y_x$.} ]

\footnotesize [ \left(\frac{x+y}{x-y}\right) \quad\text{Some text 0 $0x+y_x$.} ]

\scriptsize [ \left(\frac{x+y}{x-y}\right) \quad\text{Some text 0 $0x+y_x$.} ]

\tiny [ \left(\frac{x+y}{x-y}\right) \quad\text{Some text 0 $0x+y_x$.} ] \end{document}

The resulting PDF is attached.

Reported by: sgolovan

Original Ticket: stixfonts/tracking/87

davidmjones commented 7 years ago

Actually, this might be the way unicode-math loads math fonts. Here's the excerpt from the log:

................................................. . fontspec info: "defining-font" . . Font family 'STIXTwoMath(0)' created for font 'STIX Two Math' with options . [Renderer=Basic,BoldItalicFont={},ItalicFont={},Script=Math,SizeFeatures={{Siz e=10-},{Size=7-10,Font=STIX . Two Math,Style=MathScript},{Size=-7,Font=STIX Two . Math,Style=MathScriptScript}}]. .
. This font family consists of the following NFSS series/shapes: .
. - 'normal' (m/n) with NFSS spec.: . <10->"STIXTwoMath:mode=base;script=math;language=DFLT;"<7-10>"STIXTwoMath:mode =base;script=math;language=DFLT;+ssty=0;"<-7>"STIXTwoMath:mode=base;script=math; language=DFLT;+ssty=1;"

It means in particular that for sizes in range [7,10) the subscript optical size is used (which is intentionally clearly distinctive in STIX2 fonts).

So it's likely not a bug in the font. Though, something has to be fixed, I suppose.

Original comment by: sgolovan

davidmjones commented 7 years ago

We appreciate the feedback. This issue will be reviewed as part of our plannig for the next release.

Original comment by: stipub

davidmjones commented 6 years ago

PDF file from original bug report: paren.pdf

tiroj commented 3 years ago

@davidmjones Is this still live? It seems something specific to some flavour of TeX, yes?

John02139 commented 3 years ago

I find a similar issue using unicode-math with STIX Two Math under LuaLaTeX: Math in a footnote is a bit too large relative to footnotesize text in a 10pt document. Changing the break-point for optical sizes from 8.5 to 8 resolves the problem:

\setmathfont[%
Scale=MatchUppercase, 
RawFeature = {-ss01, -ss02, -ss08,},
% default changes to optical subscripts at 8.5, which (at 10 pt main text) makes math too large in footnotes. Below fixes it.
SizeFeatures={{Size=8-},{Size=6.25-8,Font=STIX Two Math,Style=MathScript},{Size=-6.25,Font=STIX Two Math,Style=MathScriptScript}},
]{STIX Two Math}