Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

Firefox Linux: Available Monospace Font ignored and falls back to the 3rd font on font-family font stack

  • 4 απαντήσεις
  • 1 έχει αυτό το πρόβλημα
  • 1 προβολή
  • Τελευταία απάντηση από mz_experience

more options

On GitHub page, the code block is styled with

> font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;

I have SFMono installed on the system, however, Liberation Mono is used instead.

If I update the CSS value to

> font-family: SF Mono;

Or

> font-family: SF Mono,Consolas,Liberation Mono,Menlo,Courier,monospace;

It would work properly.

What is wrong with my setup?

Below are 2 command outputs:

$ fc-match -s 'SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace' | head -2

SFMono-Regular.otf: "SF Mono" "Regular"

DroidSans.ttf: "Droid Sans" "Regular"

$ fc-match -s 'SFMono-Regular' | head -2

SFMono-Regular.otf: "SF Mono" "Regular"

DroidSans.ttf: "Droid Sans" "Regular"

On GitHub page, the code block is styled with > font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; I have SFMono installed on the system, however, Liberation Mono is used instead. If I update the CSS value to > font-family: SF Mono; Or > font-family: SF Mono,Consolas,Liberation Mono,Menlo,Courier,monospace; It would work properly. What is wrong with my setup? Below are 2 command outputs: $ fc-match -s 'SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace' | head -2 SFMono-Regular.otf: "SF Mono" "Regular" DroidSans.ttf: "Droid Sans" "Regular" $ fc-match -s 'SFMono-Regular' | head -2 SFMono-Regular.otf: "SF Mono" "Regular" DroidSans.ttf: "Droid Sans" "Regular"
Συνημμένα στιγμιότυπα

Τροποποιήθηκε στις από το χρήστη mz_experience

Επιλεγμένη λύση

I think this doesn't work for the same reason "Arial Bold" doesn't work: Firefox only wants the font family name and not a specific face name or file name.

Perhaps Github accidentally used the font's file name instead of the font name, or they meant to create an @font rule defining what "SFMono-Regular" refers to, but that got lost in the shuffle somewhere. Your guess is as good as mine.

Ανάγνωση απάντησης σε πλαίσιο 👍 0

Όλες οι απαντήσεις (4)

more options

Do other browsers understand this font name? If so, maybe they are considering the font's file name or stopping at the hyphen.

more options

jscher2000 said

Do other browsers understand this font name? If so, maybe they are considering the font's file name or stopping at the hyphen.

It seems not, I have tried Chromium, same behavior. However, I believe Firefox should use fontconfig, and the command output shows the font is properly installed and should match. Picture 2 and 3 shows it working. Why "SFMono-Regular" would cause issue?

more options

Επιλεγμένη λύση

I think this doesn't work for the same reason "Arial Bold" doesn't work: Firefox only wants the font family name and not a specific face name or file name.

Perhaps Github accidentally used the font's file name instead of the font name, or they meant to create an @font rule defining what "SFMono-Regular" refers to, but that got lost in the shuffle somewhere. Your guess is as good as mine.

more options

I think you are properly right, I ended up created an alias for "SFMono-Regular" in fontconfig, then it started to work.

 <alias>
   <family>SFMono-Regular</family>
   <prefer><family>SF Mono</family>
   </prefer>
 </alias>