w3c / mathml-core

MathML Core draft
https://w3c.github.io/mathml-core
36 stars 14 forks source link

Variable fonts and stretchy operators #122

Open fred-wang opened 5 years ago

fred-wang commented 5 years ago

cc @drott @behdad @SergeyMalkin @bkardell @tiroj

Opening this for the record...

See https://github.com/stipub/stixfonts/issues/125#issuecomment-420394717 (especially the video)

The main advantages would be that

The issue was raised during the web engines hackfest 2017 ( https://github.com/Igalia/webengineshackfest/wiki/2017#mathml-fonts ) and IIRC Behdad mentioned that main concern is that math stretching starts from a target stretch size while variable fonts starts from a variation-axis value. In general, we cannot guess which axis value will provide the proper target size without more assumptions on how the font is designed. Additionally, math font designers don't necessarily want to perfectly match a target size but sometimes just to reach something a bit larger than the target size. This is typically the case for the smallest sizes.

So I think the MathVariant subtable should be extended to somewhat have a mapping between target stretch size ranges and the proper glyph + variation-axis + variation-axis value combination: https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathvariants-table

Once this is standardized in the Open Font Format, we can add something in https://mathml-refresh.github.io/mathml-core/#size-variants-for-operators-mathvariants

tiroj commented 4 years ago

we cannot guess which axis value will provide the proper target size without more assumptions on how the font is designed

Right. As a font maker, I'd be looking to the layout and font format specs to standardise this. The existing registered OT variable font axes all have externally defined scales that enable layout interoperability, so we'd be looking for something similar in this case: an axis unit scale and scope that corresponds to the kinds of measurements the layout handler is doing to stretch operators in equations.

fred-wang commented 4 years ago

consensus from 2020/06/24: postpone to a future version of core / opentype