Changing the default font in GTK+ 2

It is common that the default font set in GTK+ 2 doesn’t suit our needs, which causes all the programs using it to look not as we would like them to. Yet, the method to change the default font is simple.

Just add the following line to the gtkrc file of the theme you are using1 (it should be somewhere in /usr/share/themes, but it may depend on the distribution):

gtk-font-name="Sans 9"

In the above example I set a size 9 Sans font as the default font. You may of course enter any correct font definition instead.

  1. If you’re not using any theme, create a new gtkrc file, enter the described line in it and set the GTK2_RC_FILES environmental variable to the path to the created file. 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s