You are not logged in.

#1 2023-12-16 19:34:16

moy0
Member
Registered: 2021-02-16
Posts: 23

[SOLVED] fontconfig not seeing local.conf?

I have two users, one on Openbox and one on XFCE. For both users when I look up the default monospace font I get:

$ fc-match monospace
NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"

I've tried setting `/etc/fonts/local.conf` and `~/.config/fonts/fonts.conf` as follows, with no results:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono Regular</family>
      <family>Liberation Mono Regular</family>
      <family>Source Code Pro Regular</family>
    </prefer>
  </alias>
</fontconfig>

After setting those config files I've tried running `fc-cache -fv`, but after I do that `fc-match monospace` still says Nimbus. In XFCE I've tried using its appearance-settings tool to set the default font but the default is still Nimbus, i.e. it's ignoring my fontconfig changes.

Specific apps: in gvim and Firefox I can override the default monospace font in my settings, but the default is still Nimbus. In VS Code I'm unable to override the font at all---no matter what I do I still get Nimbus.

What am I doing wrong?

Thanks.

Last edited by moy0 (2023-12-16 20:02:12)

Offline

#2 2023-12-16 19:50:10

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] fontconfig not seeing local.conf?

Remove "Regular", that's not part of the font name.

I use the Nerd version of JetBrains so:

~$ fc-match -a | grep JetBrains
JetBrains Mono Regular Nerd Font Complete Mono.ttf: "JetBrainsMono Nerd Font Mono" "Regular"
[...]
$ grep JetBrains .config/fontconfig/fonts.conf                                                         <
		<prefer><family>JetBrainsMono Nerd Font</family></prefer>
~$ fc-match mono
JetBrains Mono Regular Nerd Font Complete.ttf: "JetBrainsMono Nerd Font" "Regular"
~$

EDIT: and correct the directory name in ~/.config/, as per my 2nd grep. Should've noticed that first big_smile

Last edited by Head_on_a_Stick (2023-12-16 19:54:32)


Jin, Jîyan, Azadî

Offline

#3 2023-12-16 20:01:02

moy0
Member
Registered: 2021-02-16
Posts: 23

Re: [SOLVED] fontconfig not seeing local.conf?

Thanks @Head_on_a_Stick that worked! (And yeah I had the right directory name but mistyped it, thanks for catching that!)

Offline

Board footer

Powered by FluxBB