Open Bug 1807828 Opened 2 years ago Updated 2 years ago

Bad and inconsistent fallback font for mathematical symbols (⩽ and ⩾)

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 108
defect

Tracking

()

People

(Reporter: vincent-moz, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

Attached file font-lgeq.html (obsolete) —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0

Steps to reproduce:

  1. Configure the font settings to use DejaVu Sans for sans-serif and DejaVu Serif for serif (not sure whether this is useful).
  2. Open the attached testcase (font-lgeq.html).

Actual results:

In the "serif font" line (and only in this line), the ⩽ and ⩾ math symbols look different because the Latin Modern Math font is used for these characters.

Expected results:

The ⩽ and ⩾ math symbols should have been rendered in the same font as in the other lines (DejaVu Sans).

Details:

The ⩽ and ⩾ math symbols are part of the DejaVu Sans font, but not the DejaVu Serif font, while < > ≤ ≥ are in both fonts (and look the same because there are usually no differences between sans-serif and serif for such characters).

As tested with Inspector to get information about the actual fonts used by Firefox (by putting the mouse pointer over the font names to highlight the characters that are rendered in this font), when I use the "DejaVu Serif" font family in a HTML file, Firefox falls back to DejaVu Sans for ⩽ and ⩾, which is good.

But when I use the "serif" font family, though Firefox uses DejaVu Serif in my configuration, it falls back to Latin Modern Math for ⩽ and ⩾ instead of DejaVu Sans. This is bad as the chosen fallback font is very different, so that the ⩽ and ⩾ characters look different. And this is inconsistent with the DejaVu Serif test done above.

I've attached a screenshot, taken when I put the mouse pointer over "DejaVu Sans" in Inspector. This shows which characters are rendered in the DejaVu Sans font.

Note: for the test, it is needed to tick the "Allow pages to choose their own fonts, instead of your selections above" option in the Fonts settings (which is the default, AFAIK).

Here, the concerned characters are:

  • U+2A7D LESS-THAN OR SLANTED EQUAL TO
  • U+2A7E GREATER-THAN OR SLANTED EQUAL TO

But there may be the same issue for other math symbols that are not present in the current font.

Updated testcase to declare the utf-8 encoding.

Attachment #9310014 - Attachment is obsolete: true

From a cursory look, we probably go straight to font.name-list.serif.x-math pref if the symbol isn't found, which matches Latin Modern Math first.
Chrome does seem to do a bit more matching to keep in the same family.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: