-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpretation of DisplayOperatorMinHeight #126
Comments
This is the Firefox discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=407059#c8 |
This is the current text from core:
We discussed this during the two previous core meetings, but no clear conclusion so far. |
I'm removing the "Because this parameter does not always give the best size, user agents may also use the following heuristic: ensure that the large variant height is at least 2 times as large as the base height for integrals and √2 times as large as the base height for other operators. " from the spec text for now. |
That paragraph was useful for us when we were writing our implementation and trying to match the rendering from other user-agents. l'm sure you have your reasons for removing it, but if it were up to me I'd suggest perhaps keeping it as an explanatory note rather than removing it altogether. |
@faceless2 I'm trying to cleanup the spec. I agree this parameter from the OpenType MATH spec is really weird but rather than introducing hack in the spec (and implement such a thing in Chromium) to "try to match the rendering from other user-agents", I'd prefer to get clarification from Microsoft first. Last time it was discussed with Murray in a MathML Core meeting, there was not any clear conclusion. |
Chromium issue with Cambria Math On Windows: https://bugs.chromium.org/p/chromium/issues/detail?id=1408038 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
As I mentioned 3 weeks ago, we are already getting report about this bug so let's discussed this again. Per the MATH spec,
In MathML Core, this is used in layout of operators to select a glyph of height at least Note that the spec probably meant to take the smallest size with that constraint satisfied. Note that it also gives the opportunity to still find a larger variant if none is found, but this does not seem to be implemented in Chrome. I dumped below the relevant part of the MATH table from Cambria Math. Khaled Hosny commented 9 years ago:
Instead of 5/4, WebKit uses the factor √2: https://searchfox.org/wubkat/source/Source/WebCore/rendering/mathml/MathOperator.cpp#246 Firefox uses factor √2 in general, but 2 for integrals (which requires to introduce a list of characters considered "integrals"): Another option is that the "Height" means the "ink ascent" of the glyph rather than the "ink height" as supported by the following naming convention for math constants:
If so, that would make the algorithm slower because we can't just read the In any case, it would be good to get clarification from Microsoft about how it is implemented in Microsoft Office before proposing an edition to the spec.
|
Checking again the thread from March, the information provided by Microsoft is still not enough to decide how to specify the use of DisplayOperatorMinHeight. I didn't get any reply to https://lists.w3.org/Archives/Public/www-math/2023Feb/0023.html |
* opentype-axis-height.html: This is verifying Gecko's special behavior to calculate fallback for AxisHeight fallback (see nsMathMLFrame::GetAxisHeight) but that's not part of MathML Core so keep it as an internal testharness test. * opentype-limits.html: This is verifying the Gecko's interpretation of AccentBaseHeight / accent property, which is different from MathML Core so keep it as an internal testharness test. Remove failure for Win XP, which we no longer support. * opentype-fraction-dynamic-linethickness: Remove since that's covered by mathml/presentation-markup/fractions/frac-parameters-2.html * dtls-*: Tests for the dtls OpenType feature, which are not part of MathML Core. * ssty-*, mathscript-*: Tests for the ssty OpenType feature, which are not part of MathML Core. * default-font.html: This is testing Gecko's x-math preferences, so keep it as internal test. * font-inflation-1.html: This is testing Gecko's font inflation feature, so keep it as internal test. * opentype-stretchy.html: There are similar testharness tests in the official WPT but this reftest additionally checks the painting of stretchy/largeop. It's also possible that the DisplayOperatorMinHeight test specifically checks Gecko's handling of integrals which is not part of MathML Core (see w3c/mathml-core#126). For now, just keep this as internal WPT test. Mark it as random on all Windows platform as there does not seem to be an equivalent for 2d2. Differential Revision: https://phabricator.services.mozilla.com/D185291
* opentype-axis-height.html: This is verifying Gecko's special behavior to calculate fallback for AxisHeight fallback (see nsMathMLFrame::GetAxisHeight) but that's not part of MathML Core so keep it as an internal testharness test. * opentype-limits.html: This is verifying the Gecko's interpretation of AccentBaseHeight / accent property, which is different from MathML Core so keep it as an internal testharness test. Remove failure for Win XP, which we no longer support. * opentype-fraction-dynamic-linethickness: Remove since that's covered by mathml/presentation-markup/fractions/frac-parameters-2.html * dtls-*: Tests for the dtls OpenType feature, which are not part of MathML Core. * ssty-*, mathscript-*: Tests for the ssty OpenType feature, which are not part of MathML Core. * default-font.html: This is testing Gecko's x-math preferences, so keep it as internal test. * font-inflation-1.html: This is testing Gecko's font inflation feature, so keep it as internal test. * opentype-stretchy.html: There are similar testharness tests in the official WPT but this reftest additionally checks the painting of stretchy/largeop. It's also possible that the DisplayOperatorMinHeight test specifically checks Gecko's handling of integrals which is not part of MathML Core (see w3c/mathml-core#126). For now, just keep this as internal WPT test. Mark it as random on all Windows platform as there does not seem to be an equivalent for 2d2. Differential Revision: https://phabricator.services.mozilla.com/D185291
I did some experiments and I think this is essentially a bug in MS implementation. The I tested by having integrals of different heights and changing |
This seems to be consistent with the glyph sizes in Cambria Math. The |
I submitted this for OpenType spec MicrosoftDocs/typography-issues#1136 |
@khaledhosny Thanks Khaled! So it looks like MathML Core's implementation of displayOperatorMinHeight is correct and this issue can be closed... however engines will probably have to keep some hack around for backward compatibility... I wonder if such a hack should be done in HarfBuzz though, maybe https://harfbuzz.github.io/harfbuzz-hb-ot-math.html#hb-ot-math-get-constant should invert DisplayOperatorMinHeight and DelimitedSubFormulaMinHeight for some fonts that are known to have the bug (e.g. Cambria Math up to a version)? |
Probably. Please open an issue in HarfBuzz tracker to see what others think about it. |
Just converting comment from the appendix
The text was updated successfully, but these errors were encountered: