Closed hbghlyj closed 2 months ago
Ignore this comment. It goes off on an irrelevant tangent. The true discussion starts in the next comment.
MathML-Core specifies CSS rules in several instances where MathML 3.0 specifies attributes. The browsers are currently in an incomplete state of transition from MathML 3.0 to MathML-Core. Temml tries to get good rendering in all three of the major browser engines, so sometimes Temml writes both the old attribute and the new CSS.
In this case, Chromium only renders display mode correctly if CSS contains style="display: block math;"
. Chromium should then ignore the attribute, but as you have pointed out, it does not. When the attribute is not written, Chromium renders this example correctly.
I'll do some testing and see if the other browsers will render display mode correctly without that attribute. If so, I'll omit it and this issue will go away. If one of the other browsers still requires that attribute in order to render display mode, then I may not be able to help you.
It turns out that the problem occurs within the STIX TWO font. The image below shows screenshots from two fonts, Latin Modern and STIX TWO. Both screenshots show the glyphs for Unicode U+22C2 and U+22C3. For each code point, there is a standard glyph and an alternate glyph. MathML uses the alternate glyph for displaystyle
.
As you can see, Latin Modern has defined the alternate glyph with the proper vertical alignment. There is a substantial depth (descender) below the baseline. In STIX TWO, the alternate glyph is placed entirely above the baseline.
I don't think there is much that Temml can do to work around this issue. I've opened an issue in the stixfonts
repository. Unfortunately, I don't expect quick action on their part. Their last release was three years ago.
Personally, I ship the Latin Modern font. It gives me better rendering.
I suppose I could write a class when Temml writes a big operator, then do some browser sniffing in the CSS file for STIX. I dislike that sort of thing, but it may be possible. I'll give it some thought for a day.
Fixed by the workaround in release 0.10.29.
MathML generated by Temml:
in Latin Modern: in STIX TWO:
Tested in: Chrome Version 125.0.6422.77 (Official Build) (64-bit) and Chrome Version 125.0.6422.113 (Official Build) (64-bit)
in Firefox it is properly aligned