Skip to content
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

Make hb_ot_math_get_constant work around Cambria Math's bug for displayOperatorMinHeight/delimitedSubFormulaMinHeight #4653

Open
fred-wang opened this issue Apr 8, 2024 · 2 comments

Comments

@fred-wang
Copy link
Contributor

cc @khaledhosny

OpenType doc: https://learn.microsoft.com/en-us/typography/opentype/spec/math#mathconstants-table
Microsoft bug: MicrosoftDocs/typography-issues#1136 (comment)

Basically, Microsoft Word has a bug and reads displayOperatorMinHeight and delimitedSubFormulaMinHeight in the wrong order. Cambria Math seems to have the parameters inverted too, so that it still works with Microsoft Word. I don't know if because of that other math fonts were badly designed too, although I believed I reported bugs to font creators in the past.

I cannot say much about delimitedSubFormulaMinHeight. I'm not sure I understand where it's used for layout. Neither MathML Core not MathML implementations in browsers use it.

However, displayOperatorMinHeight is used by several MathML and TeX implementations to draw n-ary operators in display mode, and due to the Cambria Math bug these implementations generally ended up implementing a hack like "ensure the displaystyle is large enough, independently of the value of displayOperatorMinHeight". MathML Core and Chromium's implementation do not have such a hack.

So the question is: should HarfBuzz's hb_ot_math_get_constant work around Cambria Math's bug for displayOperatorMinHeight/delimitedSubFormulaMinHeight by inverting the value?

@behdad
Copy link
Member

behdad commented Apr 9, 2024

SGTM.

@fred-wang
Copy link
Contributor Author

I'm not sure whether Microsoft plans to release a new version of Cambria Math with that bug fixed, or if other math fonts have the issue (would be interesting to check the parameters). Anyway, I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants