Open Bug 1856705 Opened 2 years ago Updated 2 years ago

Firefox ignores Android system font "source-sans-pro"

Categories

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

Firefox 118
Unspecified
Android
defect

Tracking

()

People

(Reporter: moz, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Attached file font-family: source-sans-pro (obsolete) —

Android since Version 12 (I think) has a font-family "source-sans-pro" installed, see
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/data/fonts/font_fallback.xml#258

Firefox can't display this font and uses fallback while Chromium browsers (Edge, Opera) work as expected (see attatched testcase).
Tested with Firefox 118 and older on my Android 13 phone.

Summary: Firefox ignored Android system font "source-sans-pro" → Firefox ignores Android system font "source-sans-pro"

I suspect the actual font-family name is probably "Source Sans Pro". Does it work if you use that name?

Flags: needinfo?(moz)

No, "Source Sans Pro" dosen't work in any browser on my Android 13 device.

Flags: needinfo?(moz)

(In reply to j.j. from comment #2)

No, "Source Sans Pro" dosen't work in any browser on my Android 13 device.

... except in Firefox ...
I didn't realize that until I tested now. It's a bug anyway, no?

updated testcase: "Source Sans Pro" works in Firefox only.

Attachment #9356457 - Attachment is obsolete: true

OK, so it looks like the situation is this: there are a half-dozen Source Sans Pro .ttf files present. Their family name, as provided in the name table of the font resources, is "Source Sans Pro". That's what Firefox recognizes: it scans the installed fonts and collects all the available family names.

However, it seems that in Android they've decided to ignore the font family name provided by the font resources, and instead enumerate fonts using a sort of fontconfig-like XML file that exposes a different family name.

This seems really unfortunate/poorly-thought-out, IMO. Why expose the available fonts under non-standard names instead of their "real" names? Source Sans Pro, for example, is a well-known font family from Adobe, and it'd be natural for authors to specify font-family: "Source Sans Pro" if they want it to be used.

I suppose for compatibility, we should probably try to handle this (and other) font "aliases" that Android is using, but it makes me sad.

(In reply to Jonathan Kew [:jfkthame] from comment #5)

Their family name, as provided in the name table of the font resources, is "Source Sans Pro". That's what Firefox recognizes: it scans the installed fonts and collects all the available family names.

(that said, "Source Sans Pro" was renamed to "Source Sans <version>" or something like that)

However, it seems that in Android they've decided to ignore the font family name provided by the font resources, and instead enumerate fonts using a sort of fontconfig-like XML file that exposes a different family name.

I run into this issues several times over the years before I fond that XML files. I tend to forget those details, from my memory:

  • courier gets an courier-like font with Chromium. Firefox needs cutive mono.
  • cursive gets something expected on Chromium, Firefox needs Dancing Script (found this by accident months later).
  • Especially audacious is casual / Coming Soon. They minted a new generic family.
  • Yesterday found and instantly used: font-family: sans-serif; font-stretch: condensed; works with Firefox. Chromium ignores font-stretch and needs font-family: sans-serif-condensed.

I suppose for compatibility, we should probably try to handle this (and other) font "aliases" that Android is using, but it makes me sad.

Are this bugs in Android or in Chromium/Blink? (not that there is any hope they would change that)

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: