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

[MATH] Confusion about displayOperatorMinHeight #1136

Open
khaledhosny opened this issue Feb 22, 2024 · 5 comments
Open

[MATH] Confusion about displayOperatorMinHeight #1136

khaledhosny opened this issue Feb 22, 2024 · 5 comments
Assignees

Comments

@khaledhosny
Copy link

The description of displayOperatorMinHeight has:

Minimum height of n-ary operators (such as integral and summation) for formulas in display mode (that is, appearing as standalone page elements, not embedded inline within text).

But it has long been a source of trouble since Cambria Math sets it to a value that when respected results in too small display operators being selected: w3c/mathml-core#126

My own testing shows that Microsoft Word does not use displayOperatorMinHeight at all (setting it to any value makes no difference in which size of display operators is selected) and instead it seems to use the value of delimitedSubFormulaMinHeight to select the display operators size.

I’m speculating here, but I think it is a bug in Microsoft implementation and the wrong value in Cambria Math went unnoticed because of it.

I’m not sure what the spec should do here, but may be at least Cambria Math should be updated to use a reasonable displayOperatorMinHeight so that implmentations that follow the spec don’t have to implement various workarounds that render displayOperatorMinHeight almost useless.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@PeterCon
Copy link
Collaborator

PeterCon commented Apr 5, 2024

I checked with Office engineers who confirmed that displayOperatorMinHeight is used in math "Display" mode, but not in inline mode.

@PeterCon
Copy link
Collaborator

PeterCon commented Apr 5, 2024

Ah, but tracing back to code where the font data is being read, it appears Office may be reading displayOperatorMinHeight and delimitedSubFormulaMinHeight in the wrong order, which would account for @khaledhosny 's comment above:

instead it seems to use the value of delimitedSubFormulaMinHeight to select the display operators size.

@fred-wang
Copy link

@PeterCon Thanks for the feedback! (that seems consistent with previous discussion with Murray Sargent where apparently displayOperatorMinHeight and delimitedSubFormulaMinHeight were mixed up). So what's the plan forward here? Do you plan to fix Cambria Math? To fix Microsoft's implementation?

@PeterConstable
Copy link

My role in this is in maintaining the spec. I don't have a proposed remedy at this point. I have pointed out what I discovered to Office engineers and get their input on a proposed remedy.

If they don't want to make a code change, then that could suggest they might want a spec change, reversing the order of those fields. I would want to be very cautious, though, as I don't know what other existing implementations that could break.

Regarding Cambria Math, do I understand correctly that it has the delimitedSubFormulaMinHeight value set to what one would otherwise expect for displayOperatorMinHeight so that it provides the desired behaviour in Office (given the current bug)? If values are changed in Cambria Math, then older and newer versions of that font could behave differently. Desktop Office will use local fonts installed in the host OS, and a font fix might not get serviced in older OS versions.

@fred-wang
Copy link

Thank you @PeterConstable ; my understanding is that Cambria Math and Microsoft Word definitely have the parameters inverted compared to the spec. However, other math fonts and math rendering engines do follow the spec, albeit they have to somehow work around Microsoft's bug. I believe changing the spec would cause more harm than good.

Probably the solution would be to make sure that all the low-level APIs exposing MathConstants follow the spec, except when reading parameters from Cambria Math (up to a certain font version, if the bug is eventually fixed) where it would invert delimitedSubFormulaMinHeight / displayOperatorMinHeight values.

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

No branches or pull requests

4 participants