Changing gtk application fonts outside of gnome (Answer)

Phil Payne phil at sal-n-phil.net
Mon Jul 21 13:13:18 PDT 2003


Hi,

Caveat, I'm no GTK/Gnome expert so if someone wants to pick holes, feel 
free...

Did some further digging around on the web and I've concluded that the way to 
ensure your GTK apps appear as you want (font wise) outside of gnome is:

If you want anti-aliasing ensure the following environment variable is set:
     GDK_USE_XFT=1
Thanks to Matthew for that.

To change the default font for GTK1.* apps then add the following lines to the 
file ~/.gtkrc (or create it if it doesn't exist):

    style "default" {
        font = "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-15"
    }

Note... using full font definition.

For GTK2 based apps then things have changed. Need to add the following line 
to the file ~/.gtkrc-2.0, outside of any style definition if you want it to 
be global. (I believe that within a style definition you use the font_name = 
"" format):

    gtk-font-name = "Helvetica 12"

Note the switch to using shorthand font names.

Hope that helps anyone else stuck as I was.

Cheers,
Phil.



More information about the freebsd-questions mailing list