You are not logged in.

#1 2023-01-30 16:49:04

edge33
Member
Registered: 2023-01-29
Posts: 37

[SOLVED] Font configuration in Gnome and apps

Hi guys,
I have installed Arch on mu T14s Thinkpad laptop, and I set font using fontconfig by linking the following configs:

drwxr-xr-x  2 edge33 edge33 4096 Jan 30 15:44 .
drwxr-xr-x 22 edge33 edge33 4096 Jan 30 16:45 ..
lrwxrwxrwx  1 edge33 edge33   55 Jan 30 15:44 10-hinting-slight.conf -> /usr/share/fontconfig/conf.avail/10-hinting-slight.conf
lrwxrwxrwx  1 edge33 edge33   59 Jan 30 15:44 10-scale-bitmap-fonts.conf -> /usr/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf
lrwxrwxrwx  1 edge33 edge33   54 Jan 30 15:44 10-sub-pixel-rgb.conf -> /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf
lrwxrwxrwx  1 edge33 edge33   58 Jan 30 15:43 11-lcdfilter-default.conf -> /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf
lrwxrwxrwx  1 edge33 edge33   45 Jan 30 15:39 50-user.conf -> /usr/share/fontconfig/conf.avail/50-user.conf
-rw-r--r--  1 edge33 edge33  840 Jan 30 14:51 font.config

font.config has the following content:

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

<!-- Fallback fonts preference order -->
 <alias>
  <family>sans-serif</family>
  <prefer>
   <family>SF PRO Display</family>
   <family>Open Sans</family>
   <family>Droid Sans</family>
   <family>Roboto</family>
   <family>Tholoth</family>
   <family>Noto Sans Arabic</family>
  </prefer>
 </alias>
 <alias>
  <family>serif</family>
  <prefer>
   <family>New York</family>
   <family>Droid Serif</family>
   <family>Roboto Slab</family>
   <family>Tholoth</family>
   <family>Noto Sans Arabic</family>
  </prefer>
 </alias>
 <alias>
  <family>monospace</family>
  <prefer>
   <family>Jetbrains Mono</family>
   <family>Inconsolata</family>
   <family>Droid Sans Mono</family>
   <family>Roboto Mono</family>
  </prefer>
 </alias>

</fontconfig>

that said, according to the arch wiki, gnome disregards font-config configuration and uses the one I can set from gnome-tweaks.
that said, shouldn't apps like alacritty and vscode be able to use the fonts set with font-config?

In order to use the fonts I want for terminal and editors (Jetbrains Mono) I needed to manually set the fonts from the specific app settins (alacrity yaml and vsccode settings).

Last edited by edge33 (2023-01-31 14:26:42)

Offline

#2 2023-01-30 17:26:20

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,113

Re: [SOLVED] Font configuration in Gnome and apps

linking the following configs

Where?
Assuming that's  ~/.config/fontconfig it would be "fonts.conf", not "font.config" and you'd be better off adding this as eg. "~/.config/fontconfig/conf.d/99-defaults.conf"

fc-conflist

will print the used configuration [edit: files].

Last edited by seth (2023-01-30 17:26:35)

Offline

#3 2023-01-31 11:10:16

edge33
Member
Registered: 2023-01-29
Posts: 37

Re: [SOLVED] Font configuration in Gnome and apps

seth wrote:

linking the following configs

Where?
Assuming that's  ~/.config/fontconfig it would be "fonts.conf", not "font.config" and you'd be better off adding this as eg. "~/.config/fontconfig/conf.d/99-defaults.conf"

fc-conflist

will print the used configuration [edit: files].

thanks for the hint, that was indeed the culprit, file being named "font.config" and not "fonts.conf".

Why would it be better to put it with a low priority number like 99- ? according to the wiki, user defined configs take precedence over the others, no?

Offline

#4 2023-01-31 13:12:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,113

Re: [SOLVED] Font configuration in Gnome and apps

It's less about the priority number and more about using the modular conf.d approach.
You can use either, but the modules tend to be more manageable and less prone to be steamrolled over by some DE config tool.

Offline

#5 2023-01-31 14:26:30

edge33
Member
Registered: 2023-01-29
Posts: 37

Re: [SOLVED] Font configuration in Gnome and apps

seth wrote:

It's less about the priority number and more about using the modular conf.d approach.
You can use either, but the modules tend to be more manageable and less prone to be steamrolled over by some DE config tool.


so, can I use conf.d approach and prevent gnome-tweaks to override my settings even if I change those?

Offline

#6 2023-01-31 14:55:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,113

Re: [SOLVED] Font configuration in Gnome and apps

If you want to be absolutely sure, you'd also have to immute them w/ chattr.
But chances that gnome-teaks (or any tool) randomly messes around in conf.d are generally much lower than that it flattens fonts.conf.

Offline

#7 2023-01-31 15:05:36

edge33
Member
Registered: 2023-01-29
Posts: 37

Re: [SOLVED] Font configuration in Gnome and apps

seth wrote:

If you want to be absolutely sure, you'd also have to immute them w/ chattr.
But chances that gnome-teaks (or any tool) randomly messes around in conf.d are generally much lower than that it flattens fonts.conf.

indeed, it does not mess the conf.d files, but still, it has controls over how/what fonts are displayed over font-config

Offline

#8 2023-01-31 15:54:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,113

Re: [SOLVED] Font configuration in Gnome and apps

Per /etc/fonts/conf.d/50-user.conf fonts.conf trumps conf.d, so I guess there's a collision.
If it's not resolvable otherwise you'd have to alter the order there.

Can you please post the fonts.conf that gnome writes and the configlet you'd like to have applied?

Offline

#9 2023-01-31 20:23:54

edge33
Member
Registered: 2023-01-29
Posts: 37

Re: [SOLVED] Font configuration in Gnome and apps

seth wrote:

Per /etc/fonts/conf.d/50-user.conf fonts.conf trumps conf.d, so I guess there's a collision.
If it's not resolvable otherwise you'd have to alter the order there.

Can you please post the fonts.conf that gnome writes and the configlet you'd like to have applied?

I am not sure gnome writes config files. also According to the Arch Wiki Gnome Page, it is expected that gnome font configuration done via gnome-tweaks takes control over fontconfig, so it suggets to have the same config in fontConfig and gnome-tweak, which is what I am doing.

Unless you know where gnomes stores font config files, then I could post it here. for fontconfig the only change I did is to create a fonts.conf which has the content I posted in the first message of the thread

Offline

#10 2023-01-31 21:06:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,113

Re: [SOLVED] Font configuration in Gnome and apps

So gnome-tweaks doesn't alter anything in ~/.config/fontconfig/ ?
The default UI font for gtk will be set in ~/.config/gtk-*/settings.ini
Otherwise you'll have to be a bit more specific about the problem you're actually facing.

Offline

Board footer

Powered by FluxBB