olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

Wrong optical size math Latin Modern #37

Closed cao- closed 3 years ago

cao- commented 3 years ago

Check the following, please:

\fontfam[lm]

\typosize[30/36]

2$2$

The math number is in the wrong optical size. If you omit the \fontfam[lm] line, then the math number is in the correct optical size.

olsak commented 3 years ago

You can look at the directory .../fonts/opentype/public/lm-math/. Only one font latinmodern-math.otf is here. It is used in all sizes. Optical sizes is supported only for script and script-script sizes (implemented in this single font). I don't know Unicode math font which supports more optical sizes than basic, script and scrip-script. I know only Computer Modern family (without Unicode support) with this feature. You can combine Computer Modern 7bit with Unicode Math font, if you need optical sizes. Digits can be implemented by:

 \fontfam[lm]

\addto\_normalmath{\_loadmathfamily 0 cmr }
\addto\_boldmath  {\_loadmathfamily 0 cmbx }
\def\opdigit{\fam0 }

\typosize[30/36]

2$\opdigit 2$
cao- commented 3 years ago

Ok, thank you, now I understand the problem. Then probably it is better not to have optical sizes enabled by default, and consciously use optical sizes with a font modifier \osize like the font modifier \caps, for instance. In this way if the user cares about optical sizes, then they know what to do; if the user doesn't care about it, then they can't accidentally mix sizes like in the example above (maybe even without noticing it)

olsak commented 3 years ago

IMHO, it is not good idea to change default behavior of the most used font family. I added ony notice printed to log and recommendation to use NewComputerModern font family if optical sizes are not desired. This is done in the commit https://github.com/olsak/OpTeX/commit/d07f7a741b471c5acf1d7896956823005da874ff

cao- commented 3 years ago

Wise choice, thank you