You are not logged in.

#1 2022-10-10 13:13:33

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

Unknown font always falls back to Roboto

In GitHub, the font is set as

font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;

Since I don't have any fonts installed that are matching the first families, I expect my browser to use the fallback font monospace.
However, Roboto is used instead.

I figure this is because

$ fc-match anynoninstalledfont
Roboto-Regular.ttf: "Roboto" "Regular"

Apparently, fc-match uses Roboto in place of any unknown font.

How do I make my browsers use the fallback fonts instead of Roboto?

Offline

#2 2022-10-10 13:58:15

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

https://wiki.archlinux.org/title/Font_c … ault_fonts
Ignore the locale/lang specific stuff, but otherwise it explains how to control the substitution cascade.

Offline

#3 2022-10-10 14:05:43

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

Re: Unknown font always falls back to Roboto

What is the expected output of

fc-match nonsense

?

Offline

#4 2022-10-10 16:48:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,144

Re: Unknown font always falls back to Roboto

Im3rik wrote:

What is the expected output of

fc-match nonsense

?

It depends how you've configured fontconfig.  For example, I get

NotoSans-Regular.ttf: "Noto Sans" "Regular"

but there is no reason you should get the same result. It depends what you have in /etc/fonts/ and, possibly, in local and/or user font configuration directories. What does

fc-match monospace

give?

EDIT Typically, I believe it will default to the default sans-serif font as a result of 49-sansserif.conf, but it depends very much how you've configured things.

Last edited by cfr (2022-10-10 17:02:25)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-10-10 20:09:06

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

The browser will try

font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;

and "monospace" is generic, not "nonsense" and supposed to resolve some fixed width font.
Try to install https://archlinux.org/packages/communit … boto-mono/

If you've no fixed with font installed, it'll resolve some sans-serif and if your config is fucked up, "ex falso quodlibet".

Offline

#6 2022-10-11 09:54:36

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

Re: Unknown font always falls back to Roboto

Okay, I think my font config is not the problem.
I do have a monospace font installed, and

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

resolves correctly.

If monospace comes first in the font-family list, text is correctly rendered in my monospace font.
But once some font that I don't have installed comes before monospace, I get the fallback Roboto font.

My guess was that

fc-match nonsense

was supposed to not return any font, and that text is rendered in Roboto because all unavailable fonts are resolved to Roboto as fallback.
But since you are saying that nonsense should be resolved to the default sans font (Roboto for me), I now have no idea why my text is not rendered in monospace.

Last edited by Im3rik (2022-10-11 09:55:47)

Offline

#7 2022-10-11 12:41:29

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

Sounds like a FF bug

for font in ui-monospace SFMono-Regular "SF Mono" Menlo Consolas "Liberation Mono" monospace; do printf "$font : "; fc-match $font; done

What's your FF config for the default monospace font?

Offline

#8 2022-10-11 13:14:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,825
Website

Re: Unknown font always falls back to Roboto

seth, I think you're missing the point. "monospace" is the last element in that list and "ui-monospace" is first and "ui-monospace" is equivalent to "nonsense" as far as fontconfig is concerned.  The problem seems to be that fontconfig will give *some* font regardless of what it is passed:

$ fc-match ui-monopsace
DejaVuSans.ttf: "DejaVu Sans" "Book"

Given that fontconfig provides a font (a bad one) for "ui-monospace" the other elements of that list (the css fallbacks) are not even checked, right.  So on my system, that css font specification would also provide a non-monospace font.  I suspect this would be the case for a vast majority of users for whom the default response of font-config for a string it has no settings for (e.g., 'nonsense') is to give a default sans font.

EDIT: also note there's an error in the command in your loop, you need to quote "$font" to pass it to fc-match as some values of $font include internal spaces.

Last edited by Trilby (2022-10-11 13:16:50)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2022-10-11 13:28:41

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

Re: Unknown font always falls back to Roboto

@Trilby exactly!

$ for font in ui-monospace SFMono-Regular "SF Mono" Menlo Consolas "Liberation Mono" monospace; do printf "$font : "; fc-match "$font"; done
ui-monospace : Roboto-Regular.ttf: "Roboto" "Regular"
SFMono-Regular : Roboto-Regular.ttf: "Roboto" "Regular"
SF Mono : Roboto-Regular.ttf: "Roboto" "Regular"
Menlo : Roboto-Regular.ttf: "Roboto" "Regular"
Consolas : Roboto-Regular.ttf: "Roboto" "Regular"
Liberation Mono : LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
monospace : SourceCodePro-Regular.otf: "Source Code Pro" "Regular"

So if this is expected, and you, @Trilby are also getting a sans font for ui-monospace, would you mind opening any file in any GitHub repository and telling me if the code is in sans or monospace font?
Like this, for example: https://github.com/awesomeWM/awesome/bl … .gitignore

Last edited by Im3rik (2022-10-11 13:29:46)

Offline

#10 2022-10-11 13:29:36

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

The problem isn't fontconfig. FF should™ understand that the resolution of the element in the CSS options failed and proceed to the next.
It should™ not allow fontconfig to walk though its own substitution list (but for the last element) and take whatever the result is because fontconfig will resolve "some" font regardless of what you throw at it.

iow: the CSS substitution list should™ supersede the local font system. Always.
So if  none of ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas or "Liberation Mono" can be reasonably resolved (ie. asking FC for Menlo needs to return Menlo, not some other random font that's not Menlo) the last font to test is monospace and that's then used regardless of the ultimately resolved font.

Since monospace properly resolves on the OPs system it's not  tested, so FF shortcuts the list and goes w/ the Roboto result of something else.

Edit: github resolves the best of all monospace fonts for me (Adobe Source Code Pro, my default monospace) - albeit in chromium.
And yes, css cascade is "ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace" as well.

Last edited by seth (2022-10-11 13:31:51)

Offline

#11 2022-10-11 13:31:25

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

Re: Unknown font always falls back to Roboto

Seems like this is exactly what's happening. I would've guessed it's a FF bug, but the same thing is happening in Chrome as well.

Offline

#12 2022-10-11 13:32:40

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

seth wrote:

What's your FF config for the default monospace font?

Offline

#13 2022-10-11 13:34:47

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

Re: Unknown font always falls back to Roboto

seth wrote:

What's your FF config for the default monospace font?

It's "Default (Source Code Pro)". And it renders correctly once I put "monospace" as first item in the list.

Offline

#14 2022-10-11 13:41:13

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

happening in Chrome as well

Crome or chromium?
Is this FF/chrome from the repos or some snap/flatpak?

Offline

#15 2022-10-11 13:43:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,825
Website

Re: Unknown font always falls back to Roboto

That github code page displays properly as monospace for me.  I confirmed in my web-inspector that the active css for that element also is as you quoted.  So seth's description seems to reflect the behavior I'm seeing (the browser may request "ui-monopsace" from font-config but will not accept the DejaVu Sans suggestion from fontconfig for that and moves on to the next in the css list).

Seth, thanks for clarifying.  Fontconfig always seems to be some evil black magic to me.

Last edited by Trilby (2022-10-11 13:44:38)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#16 2022-10-11 13:44:04

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

Re: Unknown font always falls back to Roboto

Three days old FF from the repos (105.0.2-1) and latest AUR google-chrome.

Offline

#17 2022-10-11 13:46:48

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

Re: Unknown font always falls back to Roboto

I also just checked Chromium, just to be sure. Same problem.

Offline

#18 2022-10-11 13:58:41

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

Please try the repo chromium and post the output of "fc-conflist" (maybe we can find some weird config/error that the browsers stumble over)

Last edited by seth (2022-10-11 13:59:09)

Offline

#19 2022-10-11 14:03:29

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

Re: Unknown font always falls back to Roboto

$ fc-conflist
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans-mono.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-serif.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf: No description
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
+ /etc/fonts/conf.d/40-nonlatin.conf: Set substitutions for non-Latin fonts
+ /etc/fonts/conf.d/45-generic.conf: Set substitutions for emoji/math fonts
+ /etc/fonts/conf.d/45-latin.conf: Set substitutions for Latin fonts
+ /etc/fonts/conf.d/46-noto-mono.conf: No description
+ /etc/fonts/conf.d/46-noto-sans.conf: No description
+ /etc/fonts/conf.d/46-noto-serif.conf: No description
+ /etc/fonts/conf.d/48-spacing.conf: Add mono to the family when spacing is 100
+ /etc/fonts/conf.d/49-sansserif.conf: Add sans-serif to the family when no generic name
+ /home/erik/.config/fontconfig/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/local.conf: No description
+ /etc/fonts/conf.d/51-local.conf: Load local customization file
+ /etc/fonts/conf.d/57-dejavu-sans-mono.conf: No description
+ /etc/fonts/conf.d/57-dejavu-sans.conf: No description
+ /etc/fonts/conf.d/57-dejavu-serif.conf: No description
+ /etc/fonts/conf.d/58-dejavu-lgc-sans-mono.conf: No description
+ /etc/fonts/conf.d/58-dejavu-lgc-sans.conf: No description
+ /etc/fonts/conf.d/58-dejavu-lgc-serif.conf: No description
+ /etc/fonts/conf.d/60-generic.conf: Set preferable fonts for emoji/math fonts
+ /etc/fonts/conf.d/60-latin.conf: Set preferable fonts for Latin
+ /etc/fonts/conf.d/65-fonts-persian.conf: No description
+ /etc/fonts/conf.d/65-nonlatin.conf: Set preferable fonts for non-Latin
+ /etc/fonts/conf.d/66-noto-mono.conf: No description
+ /etc/fonts/conf.d/66-noto-sans.conf: No description
+ /etc/fonts/conf.d/66-noto-serif.conf: No description
+ /etc/fonts/conf.d/69-unifont.conf: No description
+ /etc/fonts/conf.d/69-urw-bookman.conf: No description
+ /etc/fonts/conf.d/69-urw-c059.conf: No description
+ /etc/fonts/conf.d/69-urw-d050000l.conf: No description
+ /etc/fonts/conf.d/69-urw-fallback-backwards.conf: No description
+ /etc/fonts/conf.d/69-urw-fallback-generics.conf: No description
+ /etc/fonts/conf.d/69-urw-fallback-specifics.conf: No description
+ /etc/fonts/conf.d/69-urw-gothic.conf: No description
+ /etc/fonts/conf.d/69-urw-nimbus-mono-ps.conf: No description
+ /etc/fonts/conf.d/69-urw-nimbus-roman.conf: No description
+ /etc/fonts/conf.d/69-urw-nimbus-sans.conf: No description
+ /etc/fonts/conf.d/69-urw-p052.conf: No description
+ /etc/fonts/conf.d/69-urw-standard-symbols-ps.conf: No description
+ /etc/fonts/conf.d/69-urw-z003.conf: No description
+ /etc/fonts/conf.d/80-delicious.conf: No description
+ /etc/fonts/conf.d/90-synthetic.conf: No description
+ /etc/fonts/fonts.conf: Default configuration file
- /usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf: Re-define fonts dirs sample
- /usr/share/fontconfig/conf.avail/09-autohint-if-no-hinting.conf: Enable autohinter if font doesn't have any hinting
- /usr/share/fontconfig/conf.avail/09-texlive-fonts.conf: No description
- /usr/share/fontconfig/conf.avail/10-autohint.conf: Enable autohinter
- /usr/share/fontconfig/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-slight.conf: Set hintslight to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-sub-pixel.conf: Disable sub-pixel rendering
- /usr/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf: Bitmap scaling
- /usr/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf: Enable sub-pixel rendering with the BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf: Enable sub-pixel rendering with the RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf: Enable sub-pixel rendering with the vertical BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf: Enable sub-pixel rendering with the vertical RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-unhinted.conf: Disable hinting
- /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
- /usr/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf: Use lcdlegacy as default for LCD filter
- /usr/share/fontconfig/conf.avail/11-lcdfilter-light.conf: Use lcdlight as default for LCD filter
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-lgc-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-lgc-sans.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-lgc-serif.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-sans.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-serif.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
- /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf: Disable hinting for CJK fonts
- /usr/share/fontconfig/conf.avail/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
- /usr/share/fontconfig/conf.avail/35-lang-normalize.conf: No description
- /usr/share/fontconfig/conf.avail/40-nonlatin.conf: Set substitutions for non-Latin fonts
- /usr/share/fontconfig/conf.avail/45-generic.conf: Set substitutions for emoji/math fonts
- /usr/share/fontconfig/conf.avail/45-latin.conf: Set substitutions for Latin fonts
- /usr/share/fontconfig/conf.avail/46-noto-mono.conf: No description
- /usr/share/fontconfig/conf.avail/46-noto-sans.conf: No description
- /usr/share/fontconfig/conf.avail/46-noto-serif.conf: No description
- /usr/share/fontconfig/conf.avail/48-spacing.conf: Add mono to the family when spacing is 100
- /usr/share/fontconfig/conf.avail/49-sansserif.conf: Add sans-serif to the family when no generic name
- /usr/share/fontconfig/conf.avail/51-local.conf: Load local customization file
- /usr/share/fontconfig/conf.avail/57-dejavu-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/57-dejavu-sans.conf: No description
- /usr/share/fontconfig/conf.avail/57-dejavu-serif.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-sans.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-serif.conf: No description
- /usr/share/fontconfig/conf.avail/60-generic.conf: Set preferable fonts for emoji/math fonts
- /usr/share/fontconfig/conf.avail/60-latin.conf: Set preferable fonts for Latin
- /usr/share/fontconfig/conf.avail/65-fonts-persian.conf: No description
- /usr/share/fontconfig/conf.avail/65-khmer.conf: No description
- /usr/share/fontconfig/conf.avail/65-nonlatin.conf: Set preferable fonts for non-Latin
- /usr/share/fontconfig/conf.avail/66-noto-mono.conf: No description
- /usr/share/fontconfig/conf.avail/66-noto-sans.conf: No description
- /usr/share/fontconfig/conf.avail/66-noto-serif.conf: No description
- /usr/share/fontconfig/conf.avail/69-unifont.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-bookman.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-c059.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-d050000l.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-backwards.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-generics.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-specifics.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-gothic.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-mono-ps.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-roman.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-sans.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-p052.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-standard-symbols-ps.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-z003.conf: No description
- /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf: Reject bitmap fonts
- /usr/share/fontconfig/conf.avail/70-yes-bitmaps.conf: Accept bitmap fonts
- /usr/share/fontconfig/conf.avail/80-delicious.conf: No description
- /usr/share/fontconfig/conf.avail/90-synthetic.conf: No description

Offline

#20 2022-10-11 14:06:46

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

+ /home/erik/.config/fontconfig/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/local.conf: No description

Looks recursion prone, please post all three files.

Offline

#21 2022-10-11 14:11:44

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

Re: Unknown font always falls back to Roboto

[erik@erik-pc ~]$ cat /home/erik/.config/fontconfig/conf.d/50-user.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <description>Load per-user customization files</description>
	<!--
	    Load per-user customization files where stored on XDG Base Directory
	    specification compliant places. it should be usually:
	      $HOME/.config/fontconfig/conf.d
	      $HOME/.config/fontconfig/fonts.conf
	-->
	<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
	<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
	<!-- the following elements will be removed in the future -->
	<include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>
	<include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>
</fontconfig>
[erik@erik-pc ~]$ cat /etc/fonts/conf.d/50-user.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <description>Load per-user customization files</description>
	<!--
	    Load per-user customization files where stored on XDG Base Directory
	    specification compliant places. it should be usually:
	      $HOME/.config/fontconfig/conf.d
	      $HOME/.config/fontconfig/fonts.conf
	-->
	<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
	<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
	<!-- the following elements will be removed in the future -->
	<include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>
	<include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>
</fontconfig>
[erik@erik-pc ~]$ cat /etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test qual="any" name="family">
        <string>ui-monospace</string>
        </test>
        <edit name="family" mode="assign" binding="same">
        <string>monospace</string>
        </edit>
    </match>
    #   <match>
    #       <edit mode="prepend" name="family"><string>Roboto</string></edit>
    #   </match>
      <match target="pattern">
          <test qual="any" name="family"><string>serif</string></test>
          <edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit>
      </match>
      <match target="pattern">
          <test qual="any" name="family"><string>sans-serif</string></test>
          <edit name="family" mode="assign" binding="same"><string>Robotos</string></edit>
      </match>
      <match target="pattern">
          <test qual="any" name="family"><string>monospace</string></test>
          <edit name="family" mode="assign" binding="same"><string>Source Code Pro</string></edit>
      </match>
</fontconfig>

I started experimenting in the last one, trying to figure out where this is coming from. It seems like this file is not doing anything (notice that I changed Roboto to Robotos to see what happens, but I still get Roboto as sans font), so I have no idea where my font config is actually configured.

Offline

#22 2022-10-11 14:24:02

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

/home/erik/.config/fontconfig/conf.d/50-user.conf is self-referencing.
Remove it (there's nothing useful inside) and restart the browser (in doubt re-login)

Offline

#23 2022-10-11 14:28:26

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

Re: Unknown font always falls back to Roboto

Still the same problem. I only added the file while trying to fix the problem (trying to make my config work).

Offline

#24 2022-10-11 14:46:32

seth
Member
Registered: 2012-09-03
Posts: 53,917

Re: Unknown font always falls back to Roboto

sad

~/.config/fontconfig/conf.d/99-default-fonts.conf

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>

<!-- Fallback fonts preference order -->
 <alias>
  <family>sans-serif</family>
  <prefer>
   <family>Roboto</family>
  </prefer>
 </alias>
 <alias>
  <family>serif</family>
  <prefer>
   <family>Noto Serif</family>
  </prefer>
 </alias>
 <alias>
  <family>monospace</family>
  <prefer>
   <family>Source Code Pro</family>
  </prefer>
 </alias>
 <alias>
  <family>ui-monospace</family>
  <prefer>
   <family>Source Code Pro</family>
  </prefer>
 </alias>
</fontconfig>

This
a) should™ allow you to impact the font
b) is an ugly workaround only

Offline

#25 2022-10-12 10:58:02

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

Re: Unknown font always falls back to Roboto

Unfortunately, I still get

$ fc-match ui-monospace
Roboto-Regular.ttf: "Roboto" "Regular"

But the file seems to be loaded. When I introduce errors there, I get error messages in fc-match.

Offline

Board footer

Powered by FluxBB