Open Bug 1818680 Opened 1 year ago Updated 4 months ago

Linux: user-defined -apple-system alias doesn't work (wrong fontconfig escaping?)

Categories

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

Firefox 112
defect

Tracking

()

People

(Reporter: lilydjwg, Unassigned)

Details

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

Steps to reproduce:

  • setup font aliases for -apple-system like this:
  <match target="pattern">
    <test qual="any" name="family">
      <string>-apple-system</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>Pick a font here</string>
    </edit>
  </match>
  • see if a font-family: -apple-system; works

Actual results:

Somehow Firefox tries to ask for FcPattern -apple-system which yields no match, so Firefox still thinks this font is uninstalled.

Expected results:

Firefox escapes the family name to \-apple\-system and passes to fontconfig to get the user-desired font.

This is a real problem because some sites prefer -apple-system (or ui-*) in their styles, and followed by a couple of fonts they think exist only when -apple-system exists (e.g. Apple Color Emoji), which isn't always true and will e.g. render digits and spaces in an emoji font.

(Or, Firefox can implement these pseudo names itself.)

PS: I find the real font name H-秀月 does work though. I don't know why.

Oh, it seems the issue only appears when there are two - in the name (ui-serif works but not ui-sans-serif).

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
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Summary: Linux: user-defined -apple-system alias doesn't work → Linux: user-defined -apple-system alias doesn't work (wrong fontconfig escaping?)
You need to log in before you can comment on or make changes to this bug.