Bad and inconsistent fallback font for mathematical symbols (⩽ and ⩾)
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
People
(Reporter: vincent-moz, Unassigned)
Details
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0
Steps to reproduce:
- Configure the font settings to use DejaVu Sans for sans-serif and DejaVu Serif for serif (not sure whether this is useful).
- 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.
Reporter | ||
Comment 1•2 years ago
|
||
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.
Reporter | ||
Comment 2•2 years ago
|
||
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.
Reporter | ||
Comment 3•2 years ago
|
||
Updated testcase to declare the utf-8 encoding.
Comment 4•2 years ago
|
||
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.
Updated•2 years ago
|
Description
•