Open Bug 1187682 Opened 4 years ago Updated 2 months ago

Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants instead of scriptsizemultiplier

Categories

(Core :: MathML, defect)

defect
Not set

Tracking

()

Tracking Status
firefox42 --- affected

People

(Reporter: fredw, Unassigned)

References

(Blocks 1 open bug, )

Details

This might be a bit controversial, but I open this for the record.

The MathML spec says that the font-size scaling factor when incrementing the script level is scriptsizemultiplier, with default value 0.71

The OpenType MATH table contains two scaling values for script levels 1 and 2, that we currently do not use:
- ScriptPercentScaleDown Percentage of scaling down for script level 1. Suggested value: 80%.
- ScriptScriptPercentScaleDown Percentage of scaling down for script level 2 (ScriptScript). Suggested value: 60%.

Currently, we always use scriptsizemultiplier but I wonder whether in some situation we should prefer the OpenType MATH constants as they are closer the the font designer's intention.

For Latin Modern Math, we have ScriptPercentScaleDown = 70% and ScriptScriptPercentScaleDown = 50%. The spec does not seem to say whether these percentages are relative to the base size or the current size. If this is the former then the MathML values .71 and .71^2=0.5041 should already be close to the values from the OpenType MATH table, so the difference will not be significant.
(Just mentioning: I opened this after Wikipedia's issue https://phabricator.wikimedia.org/T106890#1483191)

Khaled: Do you know more about the interpretation of ScriptScriptPercentScaleDown (i.e. is it relative to scriptlevel=0 size or to the scriptlevel=1 size?)
Flags: needinfo?(khaledhosny)
I think both values should be relative to the base size, that is how I interpreted them and it seems to be what MS implementation is doing IIRC.
Flags: needinfo?(khaledhosny)
(In reply to Khaled Hosny from comment #2)
> I think both values should be relative to the base size, that is how I
> interpreted them and it seems to be what MS implementation is doing IIRC.

Thanks. In that case for Latin Modern Math the values 70% and 50% should be essentially the same as .71 and .71^2=0.5041 given by scriptsizemultiplier

Putting this under MathML Core, since it's now defined here:

https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property

Also adding "see also 1548471", several existing tests use an integer scriptsizemultiplier to avoid rounding issues with script level scaling. Probably they can be replaced with tests using font with fixed ScriptPercentScaleDown & ScriptScriptPercentScaleDown, or better converting them to use testharness.js with rounding errors rather than reftests. https://w3c-test.org/css/css-fonts/math-script-level-and-math-style contains various such tests.

Blocks: mathml-core
See Also: → 1548471
You need to log in before you can comment on or make changes to this bug.