You are not logged in.

#1 2018-07-05 21:10:51

go4linux
Member
Registered: 2018-07-04
Posts: 19

[SOLVED] Changing Firefox/GTK default font

I am looking for the location that defines the default font in Firefox. By default font I mean that one that is inside the selection, like the one that defines Bitstream Vera Sans in this image:

http://i64.tinypic.com/f4r5hu.jpg

It seems to affect more applications, so I think it is actually a GTK thing, but I don't know how to change it. The global GTK configuration files, settings.ini and gtkrc (which shouldn't be used, as it is for GTK 2), have Cantarell as gtk-font-name. I don't have local files.

I am using XFCE. Do I have to install GNOME to solve the problem?
Assuming that it's a GTK thing, that is.

Last edited by go4linux (2018-07-06 14:47:29)

Offline

#2 2018-07-05 21:33:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Changing Firefox/GTK default font

You change it by selecting another (installed) font in the drop down: what is tricky about that? The Default assignation is determined by your fontconfig.

Also, read the Code and only p[ost thumbnails: http://wiki.archlinux.org/index.php/Cod … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-07-05 22:17:54

radiomike
Member
Registered: 2013-12-19
Posts: 75

Re: [SOLVED] Changing Firefox/GTK default font

Assuming that you're after more than just how to set this in firefox, have a look at Font Configuration in the wiki for where and how the default font aliases are set. Plus some examples.

N.B installing fonts-meta-base from AUR pulls in a lot of useful fonts and provides an aliases file that's easy to edit to your liking.

Offline

#4 2018-07-06 06:41:57

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Changing Firefox/GTK default font

jasonwryan wrote:

You change it by selecting another (installed) font in the drop down: what is tricky about that?

That it doesn't work. Not always at least. For example, for the archlinux.org page, I have to click on Advanced and change the settings for Latin, specifically for the sans-serif font. The advanced settings all point to the Default fonts.
Also, as I said that seems to affect other applications. I am saying this because I couldn't get rid of a monospace font appearing everywhere, until I installed more fonts.

jasonwryan wrote:

Also, read the Code and only p[ost thumbnails: http://wiki.archlinux.org/index.php/Cod … s_and_code

I did. The image was 13.6 kB, so that wasn't a problem. I wasn't sure about the size, since the image was 791x172. So I decided to go the easy way: check the preview, assuming I would be notified if the image was too big. I guess I was wrong.
Next time I will post a link. Looks easier

radiomike wrote:

Assuming that you're after more than just how to set this in firefox, have a look at Font Configuration in the wiki for where and how the default font aliases are set. Plus some examples.

Thank you. I did look at it, just maybe too quickly. However, I am not sure it is what I need.
If I understand correctly, the idea would be to replace the Bitstream Vera fonts with some fonts I would like to use. If that is correct, I think that also means that it won't be possible to use the Bitstream Vera fonts, as they will always be replaced. Is that right?

radiomike wrote:

N.B installing fonts-meta-base from AUR pulls in a lot of useful fonts and provides an aliases file that's easy to edit to your liking.

Ah, thanks. I will look at it when I will look at the AUR :-D
I am not there yet.

It really looks like something happens when I install a font, just I don't know what.

Last edited by go4linux (2018-07-06 06:42:35)

Offline

#5 2018-07-06 07:13:21

radiomike
Member
Registered: 2013-12-19
Posts: 75

Re: [SOLVED] Changing Firefox/GTK default font

go4linux wrote:
radiomike wrote:

Assuming that you're after more than just how to set this in firefox, have a look at Font Configuration in the wiki for where and how the default font aliases are set. Plus some examples.

Thank you. I did look at it, just maybe too quickly. However, I am not sure it is what I need.
If I understand correctly, the idea would be to replace the Bitstream Vera fonts with some fonts I would like to use. If that is correct, I think that also means that it won't be possible to use the Bitstream Vera fonts, as they will always be replaced. Is that right?

You don't replace the fonts, just change the fontconfig rules that give bitstream Vera as the result when you use an alias like "sans" or "sans serif" to select the font. Bitstream Vera fonts will still be accessible directly.

go4linux wrote:

It really looks like something happens when I install a font, just I don't know what.

Either your font is adding new rules to fontconfig which will change the defaults, or it ends up as a preferred option based on the existing rules.

Offline

#6 2018-07-06 10:13:50

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Changing Firefox/GTK default font

radiomike wrote:

Either your font is adding new rules to fontconfig which will change the defaults, or it ends up as a preferred option based on the existing rules.

Yes, that was it. The file /etc/fonts/conf.avail/60-latin.conf had something like:

        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>Bitstream Vera Sans</family>
                        <family>DejaVu Sans</family>
                        <family>Verdana</family>
                        <family>Arial</family>
                        <family>Albany AMT</family>
                        <family>Luxi Sans</family>
                        <family>Nimbus Sans L</family>
                        <family>Nimbus Sans</family>
                        <family>Helvetica</family>
                        <family>Lucida Sans Unicode</family>
                        <family>BPG Glaho International</family> <!-- lat,cyr,arab,geor -->
                        <family>Tahoma</family> <!-- lat,cyr,greek,heb,arab,thai -->
                </prefer>
        </alias>

I just added a family at the top, before the Bitstream Vera Sans:

                        <family>Noto Sans</family>

It's still unclear why now Firefox takes Noto as global default if I specify it only in the Latin configuration, but at least it works.

Many thanks

Offline

#7 2018-07-06 10:36:07

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Changing Firefox/GTK default font

go4linux wrote:

Yes, that was it. The file /etc/fonts/conf.avail/60-latin.conf had something like:

That file will be overwritten on package update.

go4linux wrote:

It's still unclear why now Firefox takes Noto as global default if I specify it only in the Latin configuration, but at least it works.
Many thanks

It is the default for content detected as being in Latin based languages if that is the only type of language you view in firefox it would become effectively a global default.

Offline

#8 2018-07-06 11:18:29

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Changing Firefox/GTK default font

loqs wrote:

That file will be overwritten on package update.

crap, I should have known that. Thanks for that.

So, now I have the problem of setting the right order. If I want to do that globally, how do I do that? Doing that in local.conf doesn't seem to work. Adding a file 99-local.conf doesn't work either.

Coming to think of it, how does 60-latin.conf know that it's for Latin? There is no mention of it in the file.

The man page doesn't help a lot. Some more knowledgeable advice might help.

loqs wrote:

It is the default for content detected as being in Latin based languages if that is the only type of language you view in firefox it would become effectively a global default.

Maybe I misunderstand your answer, but it appears as generic default font in the preferences. It's not content related.

Offline

#9 2018-07-06 13:27:52

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Changing Firefox/GTK default font

Font_configuration#Fontconfig_configuration I would suggest using $XDG_CONFIG_HOME/fontconfig/fonts.conf or 99-local.conf which you already tried.
With the content from Font_configuration#Replace_or_set_default_fonts  setting the default sans-serif to Noto Sans etc.

Offline

#10 2018-07-06 14:47:14

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Changing Firefox/GTK default font

Okay, so I copied my 99-local.conf into $XDG_CONFIG_HOME/fontconfig/fonts.conf and that worked. Very odd.
Then I noticed that local configuration is loaded from the 50-user.conf file. So I tried two things:

1) copying my 99-local.conf into /etc/fonts/conf.d/60-local.conf. That didn't work
2) copying my 99-local.conf into /etc/fonts/conf.d/60-before-latin.conf. That worked.

Recall that the original font preferences are set in the 60-latin.conf file.

So it seems that it's a configuration loading order problem. The files that are read first set the values, and they are not overwritten by the files that are read later, as I would expect.
Maybe they could add it to the fontconfig documentation. That would help.

So, hopefully now I'm done with this problem. Thanks for the help.

Offline

Board footer

Powered by FluxBB