Open Bug 1889951 Opened 2 years ago Updated 2 years ago

Incorrect fontconfig font substitution when no lang html attribute set

Categories

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

Firefox 124
defect

Tracking

()

UNCONFIRMED

People

(Reporter: hanabishi, Unassigned)

Details

Attachments

(4 files)

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

Steps to reproduce:

When no lang attribute set for html document (or for element individually), FF performs wrong fontconfig font substitution.

But I found a weird connection. Seems like when the lang attribute is undefined or empty string, FF puts the LANG env variable value there. But this is a mistake, as its typical value is something like "en_US.UTF-8", which is seemingly not a valid language tag for fontconfig.

This is actually can be easily tested. If you run FF with "LANG=en" env variable set, it works as intended, as if lang="en" html attribute was set. But this is obviously wrong value for LANG env variable by all means.

Attached file test-lang.html
Attached file test-nolang.html

Attached screenshots and test html documents.

In addition why "LANG=en" env variable is wrong. FF actually fallbacks to 'C' locale in this case. But still substitutes the original value for html lang attribute.

$ LANG=en firefox
[34091, Main Thread] WARNING: Locale not supported by C library.
Using the fallback 'C' locale.: 'glib warning', file /usr/src/debug/firefox/firefox-124.0.2/toolkit/xre/nsSigHandlers.cpp:187

(firefox:34091): Gtk-WARNING **: 14:24:18.498: Locale not supported by C library.
Using the fallback 'C' locale.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: