Open Bug 1923562 Opened 1 year ago Updated 4 months ago

Disable mathvariant_styling_fallback by default

Categories

(Core :: MathML, task)

task

Tracking

()

People

(Reporter: fwang, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

See bug 1789083. Two years ago, Android didn't have fonts for the text-transform: math-auto but maybe this has changed in recent versions of Android.

(In reply to Frédéric Wang (:fredw) from comment #0)

See bug 1789083. Two years ago, Android didn't have fonts for bold/italic/bold-italic but maybe this has changed in recent versions of Android.

It seems this is causing mozilla/mathml/scripts/subscript-italic-correction.html to fail on "Android 7.0 x86-64 opt":

[task 2025-08-01T13:05:16.430+00:00] 13:05:16 INFO - TEST-UNEXPECTED-FAIL | /_mozilla/mathml/scripts/subscript-italic-correction.html | Italic correction of base is used to place subscripts. - assert_greater_than: expected a number greater than 2 but got 1
[task 2025-08-01T13:05:16.430+00:00] 13:05:16 INFO - verifyItalicCorrections@http://web-platform.test:8000/_mozilla/mathml/scripts/subscript-italic-correction.html:19:30
[task 2025-08-01T13:05:16.486+00:00] 13:05:16 INFO - TEST-OK | /_mozilla/mathml/scripts/subscript-italic-correction.html | took 556ms

which is likely related to the fallback not being used.

Also this does not make the following test pass:

https://searchfox.org/mozilla-central/rev/1d3c8311925d252ae79c223a53b65e667c810805/testing/web-platform/mozilla/meta/mathml/mathvariant/mathvariant-basic-transforms-with-default-font.html.ini

So I guess we cannot remove this fallback yet on android.

Attached image no-math-font.jpg

At the moment Android still doesn't bundle any math font, which causes very poor rendering.

Debugging a page with math content on a Pixel 9 says that it is trying to render the characters using Roboto and Noto Sans Symbols. I checked with fontforge and neither of this fonts have characters for the "Mathematical Alphanumeric Symbols" block. Doing a font search, it seems to be using something close to Times New Roman Italic for rendering the mathvariant characters.

A font like Noto Sans Math (or Latin Modern Math) is misising. The source code shows that it is not bundled, since Noto fonts stopped being updated a year ago blocked by issue 366415133. There has been some attempts to update the fonts, but this was the response:

At this time, we're working on updating our infrastructure to handle font file updates via build flags. This means we're not able to integrate your patch in its current form.

I commented on this issue mentioning the importance of having a math font for proper rendering.

(In reply to eri from comment #5)

A font like Noto Sans Math (or Latin Modern Math) is misising. The source code shows that it is not bundled, since Noto fonts stopped being updated a year ago blocked by issue 366415133. There has been some attempts to update the fonts, but this was the response:

At this time, we're working on updating our infrastructure to handle font file updates via build flags. This means we're not able to integrate your patch in its current form.

I commented on this issue mentioning the importance of having a math font for proper rendering.

I checked the git history and it seems the mentioned build flag has been introduced now and some fonts have been updated. Will take a look.
I opened https://issuetracker.google.com/u/0/issues/498266576 but don't have editbug permission it seems.

(In reply to Frédéric Wang Nélar from comment #6)

I checked the git history and it seems the mentioned build flag has been introduced now and some fonts have been updated. Will take a look.
I opened https://issuetracker.google.com/u/0/issues/498266576 but don't have editbug permission it seems.

I attached some patches to add Noto Sans Math, but haven't gotten any review feedback. Maintainer replied "We have shared this with our product and engineering team and will update this issue with more information as it becomes available." and made the bug depend on the internal issue https://issuetracker.google.com/issues/498549479

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: