There are some apps for Windows and Linux that use the Gtk cross-platform library. I'm using Gaim (chat/IM) and Gimp (paint) in Windows, and both use Gtk. Unfortunately Gtk is primarily a Linux library; using it in Windows is sometimes awkward. In particular, there's no obvious way to change the font size or colors. That's because in Linux (with Gnome) you use Gnome to change the default colors and fonts. But in Windows, I'm not using Gnome, so there's no obvious way to do this.

The solution is to find your home directory (C:\Documents and Settings\username) and create a text file named .gtkrc-2.0 containing this:

style "win32-font" {
  font_name = "tahoma 12"
}
class "*" style "win32-font"

Then restart your Gtk-based app. Thanks to the PyGtk FAQ for this tip. Note that this also works in Linux.

Update [2006-01-26]: It turns out Windows Explorer (the GUI shell) does not let you create files named .gtkrc-2.0. You can either use the DOS window for this, or Save As in your editor (e.g., Notepad).

Labels:

19 comments:

Anonymous wrote at September 08, 2005 4:36 AM

The wimp/ms-windows-theme is supposed to pick up it's font settings from the windows settings.

Anonymous wrote at November 01, 2005 9:46 AM

I'm using WinXP and GAIM: I'd love to increase the size of the fonts. I understand HOW to (i.e. with the file...) but I can't seem to make Windows name a file beginning with a period. The FAQ also mentions the path for this file should be .theme\... and I can't name a folder beginning with a period.

Any suggestions???
larryk@dejazzd.com

Anonymous wrote at November 01, 2005 9:49 AM

If wimp picks up it's font settings from Windows, where is that font setting set?
larryk@dejazzd.com

Matt Campbell wrote at November 06, 2005 11:01 PM

Thanks for this tip. I'm visually impaired, so being able to adjust the font size is especially important to me. I had wanted to use Gaim on Windows, as I do under GNOME, but the font was too small. So thanks again for showing how to fix that.

Anonymous wrote at November 20, 2005 9:15 PM

I found this trying to figure out the same thing. I figured it out. You can put dots in front of files from a DOS prompt.

The proper file name is
.gtkrc-2.0
and it goes in
C:\Documents and Settings\{username}\

The file contents of his example work.

Anonymous wrote at December 10, 2005 5:02 PM

Hey man! Tnx a lot. I use the portable Gaim version, and the file was located at

..\PortableGaim\gaim\etc\gtk-2.0

Regards

Anonymous wrote at January 30, 2006 7:44 PM

Hey, i successfully created the text file named ".gtkrc-2.0" with the string mentioned above in my C:\Documents and Settings\{username}\ and restarted GAIM afterwards and it still was a tiny font. Any help would be greatly appreciated... theXfactor@gmail.com

Anonymous wrote at January 31, 2006 9:35 AM

Not sure that this'll help everyone, but:

C:\Documents and Settings\username\.themes\Default\gtk-2.0\gtkrc

works for me.

I was able to make the folders with win explorer, and I used gvim to make the file, which contains:

gtk-font-name = "Verdana 9"

Note; I'm still not completely happy as I'd prefer to be able to adjust the font from within Gaim itself.

Anonymous wrote at April 10, 2006 1:05 AM

Thanks a bunch man! I just started using Gaim, and found the font size to be much too small. The official Gaim website doesn't give any helpful info on this problem, and it really should.

It's also worth noting that this only changes the way that fonts are displayed on the Gaim user's end. Text sent in IM windows is still formatted according to the settings in Gaim preferences.

Anonymous wrote at May 29, 2006 12:55 PM

thanks so much, i've been tearing my hair out trying to fix my teensy fonts.

goonmaster wrote at June 20, 2006 7:00 AM

To create a folder in Windows starting with a dot (period) you need to use DOS.

Start> Run> (then type cmd and press ok

Go to this directory

C:\Documents and Settings\{username}\

then type MD .themes

[make directory]

then in THAT make a directory called "Default"

then in THAT make a directory called "gtk-2.0"
in which you create a text file named .gtkrc-2.0

*******************************

style "win32-font" {
font_name = "tahoma 12"
}
class "*" style "win32-font"

*******************************


Thats it!

Anonymous wrote at August 05, 2006 11:36 AM

Oh my GOD, this should seriously be implemented in GAIM itself. This is a VERY useful option here. I was squinting to see the tiny fonts, and I still couldnt read them even then. This WORKS. This should be implemented in GAIM for windows. Not everyone uses linux as indicated by the number of downloads GAIM has at sourceforge.

Anonymous wrote at August 14, 2006 6:18 PM

Thanks. I hate Aim so i switched to Gaim and this post was exactly what I was looking for.

Anonymous wrote at August 20, 2006 10:06 PM

Is there any way to use this and retain seeing other people's fonts? Just magnify the size?

Spencer! wrote at August 23, 2006 6:22 PM

I would love to have this addition to my Gaim, I was using a solution by turning off formatting in options, but this is a crappy solution, this one would be a lot better.

BUT I tried creating a folder in the directory and I would start Gaim and get an error and it would close. So I tried the other way posted on here (creating a .themes folder etc via DOS) that also failed.

Anyone else have this happen? Any help would be greatly appreciated.
teddyki@gmail.com

Marcus wrote at August 27, 2006 3:23 PM

Great! Thank you.

This is a blanket solution, do you know how to make certain fonts smaller (like the buddy list) and other fonts larger (like instant message windows)? I imagine it is in using the class tag. Thanks!

mericsson [at] gmail.com

Anonymous wrote at August 30, 2006 9:52 AM

THANK YOU for how-to change the fonts. This should be a configurable option in the GAIM preferences.
I use portable GAIM v1.5.0 on Windows XP and I discovered that the settings go in this file:
PortableGaim\gaim\etc\gtk-2.0\gtkrc

ed wrote at October 27, 2006 7:11 AM

if you use 1.5, click the plugins link on the gaim main page, and install the extended preferences. It will do all the basic formatting without having to fool around with obscure Gtk files.

Stefan Isarie wrote at October 31, 2006 11:52 AM

Thanks for sharing! I would have uninstall GAIM if I would not find your solution!

Post a Comment