You are not logged in.

#1 2021-06-19 13:07:26

DireWolf
Member
Registered: 2021-04-15
Posts: 28

[SOLVED] Setting default font

I just installed gimp, and a dependency was gsfonts, after the install the fonts changed,
Where can I specifiy the default font?

fc-match earlier returned:
NotoSans-Regular.ttf: "Noto Sans" "Regular"

Now returns:
NimbusSans-Regular.otf: "Nimbus Sans" "Regular"


I use dwm as the window manager

Last edited by DireWolf (2021-10-10 08:11:06)

Offline

#2 2021-06-19 13:36:11

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Setting default font

You can set your preferred fonts in ~/.config/fontconfig/fonts.conf. For example:

<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>JetBrains Mono</family>
        </prefer>
    </alias>
    <alias>
        <family>serif</family>
        <prefer>
            <family>Noto Serif</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Noto Sans</family>
        </prefer>
    </alias>
</fontconfig>

Offline

#3 2021-06-19 15:56:19

Flemur
Member
Registered: 2012-05-24
Posts: 72

Re: [SOLVED] Setting default font

DireWolf wrote:

I just installed gimp, and a dependency was gsfonts, after the install the fonts changed,
Where can I specifiy the default font?

For gimp, they're defined (an override from the default font) in
/usr/share/gimp/2.0/themes/Dark,Gray,Light,System/gtkrc
[c]#gtk-font-name = "Sans 11"[/c] <-- uncomment it; and a few lines later there's another font_name, and also font scaling further down.

fc-match earlier returned:

The installer changing the default fonts was pretty rude!  tucuxi's solution should work to set the defaults to whatever you want.


"If you do not change direction, you may end up where you are heading." -- L.T.

Offline

#4 2021-06-19 17:40:16

DireWolf
Member
Registered: 2021-04-15
Posts: 28

Re: [SOLVED] Setting default font

Thanks @tucuxi and @Flemur, thanks for speedy replies...

My .config/fontconfig was empty so I created a file with what example tucuxi posted..... and then installed gimp.
It again overrode the system defaults, and shifted into some shitty font,

Its not the font so much but it doesnt mix well with the status bars and spacing and height makes it look bad.

The "rude" installer does this (i use pacman):

[2021-06-19T18:58:06+0530] [PACMAN] Running 'pacman -R gsfonts libwmf graphviz gimp'
[2021-06-19T18:58:09+0530] [ALPM] transaction started
[2021-06-19T18:58:10+0530] [ALPM] removed gimp (2.10.24-4)
[2021-06-19T18:58:10+0530] [ALPM] removed graphviz (2.47.2-1)
[2021-06-19T18:58:10+0530] [ALPM] removed libwmf (0.2.12-2)
[2021-06-19T18:58:10+0530] [ALPM] removed gsfonts (20200910-2)
[2021-06-19T18:58:10+0530] [ALPM] transaction completed
[2021-06-19T18:58:10+0530] [ALPM] running '30-systemd-update.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running '40-fontconfig-config.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running 'fontconfig.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running 'gdk-pixbuf-query-loaders.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running 'gtk-update-icon-cache.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running 'update-desktop-database.hook'...
[2021-06-19T18:58:10+0530] [ALPM] running 'xorg-mkfontscale.hook'...
[2021-06-19T22:58:31+0530] [PACMAN] Running 'pacman -S gimp'
[2021-06-19T22:58:37+0530] [ALPM] transaction started
[2021-06-19T22:58:37+0530] [ALPM] installed gsfonts (20200910-2)
[2021-06-19T22:58:37+0530] [ALPM] installed libwmf (0.2.12-2)
[2021-06-19T22:58:37+0530] [ALPM] installed graphviz (2.47.2-1)
[2021-06-19T22:58:38+0530] [ALPM] installed gimp (2.10.24-4)
[2021-06-19T22:58:38+0530] [ALPM] transaction completed
[2021-06-19T22:58:38+0530] [ALPM] running '30-systemd-update.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running '40-fontconfig-config.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running 'detect-old-perl-modules.hook'...
[2021-06-19T22:58:38+0530] [ALPM-SCRIPTLET] WARNING: '/usr/lib/perl5/5.32' contains data from at least 26 packages which w
lled perl interpreter.
[2021-06-19T22:58:38+0530] [ALPM-SCRIPTLET]  -> Run the following command to get a list of affected packages: pacman -Qqo
[2021-06-19T22:58:38+0530] [ALPM] running 'fontconfig.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running 'gdk-pixbuf-query-loaders.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running 'gtk-update-icon-cache.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running 'update-desktop-database.hook'...
[2021-06-19T22:58:38+0530] [ALPM] running 'xorg-mkfontscale.hook'...

i included the portion from when i removed gimp ( and everything works) to where i installed it after making the config file...

@tucuxi do i Have to run some script for the config file to take effect?

Last edited by DireWolf (2021-06-19 17:40:38)

Offline

#5 2021-06-19 18:00:08

loqs
Member
Registered: 2014-03-06
Posts: 18,996

Re: [SOLVED] Setting default font

Have you read Font_configuration#Replace_or_set_default_fonts?
What is the output of the following with and without gsfonts installed?

fc-match sans
fc-match serif
fc-match monospace

Offline

#6 2021-06-19 18:05:19

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Setting default font

No, but you need to enable 50--user.conf, which should be the default.

What do you get from:

stat /etc/fonts/conf.d/50-user.conf 

And from

fc-match -s sans-serif

Offline

#7 2021-10-10 08:10:22

DireWolf
Member
Registered: 2021-04-15
Posts: 28

Re: [SOLVED] Setting default font

Thanks @tuxuci and all,
tux's solution was right.
Apart from my dumb ignorance, that his monospcae was mapped to jetbrain's mono, whilst I did not have that typeset.
I mapped it to Noto Sans and everything works perfect.
roll big_smile

Marking as solved

Offline

Board footer

Powered by FluxBB