You are not logged in.

#26 2022-10-12 12:07:41

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

fc-match syntax is finicky, but

fc-match ui\\-monospace

should work.

Offline

#27 2022-10-13 07:59:52

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

Okay, that works:

$ fc-match ui\\-monospace
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"

However, the text in GitHub is still not in monospace. I restarted Firefox and did a re-login, just to be sure. Same for Chrome.

Offline

#28 2022-10-13 08:19:06

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

Are you absolutely positively sure that it's Roboto and not Liberation Mono? (Cause that would get resolved)
=> Screenshot?

Offline

#29 2022-10-13 08:52:58

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

Absolutely sure. It's a sans font, and I just double-checked that it's Roboto by comparing with the Google Fonts type tester.

Offline

#30 2022-10-13 09:15:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,428

Re: Unknown font always falls back to Roboto

Browsers can have their own font resolution mechanisms, did you double check their settings? (in particular chrome pretty much ignores any other font config)

Offline

#31 2022-10-13 09:15:34

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

What happens if you remove Liberation from the CSS cascade?

Offline

#32 2022-10-13 09:17:43

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

Even

font-family: nonsense,monospace;

gives me Roboto in both Firefox and Chrome.
Once the first font in the cascade is mono or monospace, I get Source Code Pro.

Offline

#33 2022-10-13 09:33:50

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

Try a fresh profile or new user.
This has to be something in the browser config or maybe some extension you share among browsers.

Otherwise

pacman -Qs 'fontconf|harf|freetype|pango'

Offline

#34 2022-10-13 09:37:42

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

A fresh browser profile, you mean? I just installed Chromium and Opera to make sure that it has nothing to do with extensions and browser config. Same problem there.

$ pacman -Qs 'fontconf|harf|freetype|pango'
local/fontconfig 2:2.14.0-1
    Library for configuring and customizing font access
local/freetype2 2.12.1-1
    Font rasterization library
local/harfbuzz 5.2.0-1
    OpenType text shaping engine
local/harfbuzz-icu 5.2.0-1
    OpenType text shaping engine - ICU integration
local/libxft 2.3.6-1
    FreeType-based font drawing library for X
local/pango 1:1.50.11-1
    A library for layout and rendering of text
local/pangomm 2.46.3-1
    C++ bindings for Pango
local/pangomm-2.48 2.50.1-1
    C++ bindings for Pango

Offline

#35 2022-10-13 13:17:59

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

So "unfortunately" no stale AUR packages (though I doubt it's fontconfig related anyway)

fc-list :spacing=100 | grep -i roboto

If you make something else your default sans font (or in doubt just remove the monospace package), do you end up w/ yet another sans serif font or Liberation Mono resp. Source Code Pro (if you also remove the Liberation fonts)?

Offline

#36 2022-10-13 14:28:14

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

It works! I changed my default sans font, and while I was at it, I deleted the commented out part that I showed earlier in /etc/fonts/local.conf

    #   <match>
    #       <edit mode="prepend" name="family"><string>Roboto</string></edit>
    #   </match>

I don't know why I had this in there, but after deleting it, everything works as expected.
The interesting part is that this comment does not change the output of fc-match. But for some reason, it breaks the browsers.

Thank you all very much!

Last edited by Im3rik (2022-10-13 14:32:11)

Offline

#37 2022-10-13 14:34:10

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: Unknown font always falls back to Roboto

What was the context of the match/edit, ie. the config before the fix?
fonts.conf is xml, comments go like "<!-- comment -->"

Offline

#38 2022-10-13 14:37:03

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Unknown font always falls back to Roboto

I don't know, I had it there for a long time. It probably took me a long time to notice that GitHub code is not in monospace.
I guess I edited this file in vscode, used the "auto comment" function, and just assumed that vscode chose the correct comment style.

Offline

Board footer

Powered by FluxBB