Closed Bug 1187682 Opened 9 years ago Closed 2 years ago

Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants instead of scriptsizemultiplier

Categories

(Core :: MathML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox42 --- wontfix
firefox106 --- fixed

People

(Reporter: fredw, Assigned: fredw)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

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
See Also: → 1667090
Assignee: nobody → fred.wang
Status: NEW → ASSIGNED
Attachment #9178236 - Attachment description: Bug 1187682 - Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants → Bug 1187682 - Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/20fadec3e9dc
Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/25948 for changes under testing/web-platform/tests
Upstream PR was closed without merging

not going back to this in the short term

Flags: needinfo?(fred.wang)

Sorry, there was a problem with the detection of inactive users. I'm reverting the change.

Assignee: nobody → fwang
Status: NEW → ASSIGNED
Pushed by fred.wang@free.fr:
https://hg.mozilla.org/integration/autoland/rev/317a9610fc6d
Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: