Using GTK Themes for GIMP on Win32 Systems This document describes the basic configuration of Gtk Themes for the GIMP running under Win32 systems. Table Of Contents 1. Document Conventions 2. Background 3. Adding Themes to Gtk 4. Fonts 5. Conclusion Appendix A. About this Document A.1. Location of this Document A.2. Contact Information A.3. Copyright Information Appendix B. Revisions to this Document 1. Document Conventions In versions of this document that support it, text markup is used. An effort has been made to make this markup obvious to non-markup systems. * Words in ALL CAPS MONOSPACE are placeholders for implementation-specific information * "Double-quoted emphasized" text denotes an example * 'Single-quoted strong' text should be typed in verbatim, minus the surrounding single-quotes. Substitute backward-slashes for forward-slashes where appropriate in file names. I use perlish forward-slashes to avoid escaping confusion. 2. Background This document assumes that you have successfully installed the GIMP and have no problems running it. (Albeit themelessly.) The path you have GIMP installed to (ex. "c:/gimp") will be referred to as GIMP_HOME for simplicity and to avoid confusion. Your GTK themes should be installed in an entirely different directory (ex. "c:/gtk/themes") which shall be referred to as THEME_HOME. Each theme has a name (ex. "Marble3D") which will be referred to as THEME_NAME. Normally, when you install a theme (that is, unzip the archive) you will do so into the THEME_HOME/THEME_NAME (ex. "c:/gtk/themes/Marble3D"). In the THEME_HOME/THEME_NAME directory you will probably have a "gtk" directory, in which lives a "gtkrc" text file. Since the "gtk" directory is not necessary, just make sure you find the "gtkrc" text file. This file, including the full path to it, will be referred to as THEME_GTKRC (ex. "c:/gtk/themes/Marble3D/gtk/gtkrc"). While it may seem rather redundant to have a theme-specific "gtk" directory at all, this is actually a carryover from Gtk's Linux roots. Many applications (such as Enlightenment) use themes different than those used by Gtk. However, they can probably use much of the same information (such as images). It is a sanity-check to keep implementation-specific information in separate directories, so the "gtk" directory may have different sibling directories (such as "e") for the different themed applications. Feel free to move things around, but it will generally be easier to leave them how you got them. This THEME_GTKRC text file is not to be confused with your user's GIMP-Gtk resource file. This file will normally live in "%HOMEDIR%/_gimp1.1/gtkrc", where "%HOMEDIR%" is your home directory which will default to "c:" if the environment variable is not set. This file, and again the full path to it, will be referred to as USER_GTKRC. Also note that this is not the "gimprc" file in GIMP_HOME, which we aren't going to mess with. (Yes, these things seem to be multiplying ...) Got all that? Good. Let's begin now ... 3. Adding Themes to Gtk As I've alluded to, installing a theme should normally be as simple as unzipping the archive into the THEME_HOME directory. This document does not attempt to cover Gtk theme creation. From this point we will assume that you are able to do this and that all the tenets put forth in Background still hold. User-created themes are available from gtk.themes.org. To make your GIMP see the Gtk themes, you will need to edit the USER_GTKRC text file (not the THEME_GTKRC). This is a plain text file, so use an appropriate editor (like Notepad, but not WordPad). You will bee adding directives and file paths. When you type in the path, don't forget the surrounding double-quotes and to escape all the backslashes (see below for an example). One would hope that eventually, Gtk (and GLib) won't care about slash-direction. If there are duplicate directives in the resource file, comment out the old ones by putting a hash mark '#' as the first character of the line. First, you will need to add in the 'module_path' directive. Normally, this will point to "THEME_HOME/engines". Next, you need to directive-include (not cut-and-paste) your THEME_GTKRC file with an 'include' directive. The third and final directive is a theme-path directive. This directive will be named 'THEME_NAME_path' and will be the path (not including the file) for THEME_GTKRC, which is normally "THEME_HOME/THEME_NAME/gtk". An example of this might be: module_path "c:\\gtk\\themes\\engines" include "C:\\gtk\\themes\\marble3D\\gtk\\gtkrc" marble3D_path "C:\\gtk\\themes\\marble3D\\gtk" Including these 3 directives will let you use themes. That's it, it's that simple. 4. Fonts By now you've hopefully tried out these changes and seen that they work beautifully ... until you come back frustrated because you installed your theme and it all looks nice except for the barely-legible font. Most themes are Helvetica-based, which Windows doesn't have installed by default. Also, other themes use other fonts which you probably won't have. To fix this, you need to tell GTK what font you want to use. I like Tahoma, so it is going to be our example. In the THEME_GTKRC file you'll need to find all occurrences of the 'font' directive. Any one of them may be something akin to: font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*" There are two in the USER_GTKRC file, and there is probably one or more in the THEME_GTKRC file. You don't *have* to change the ones in the master file, but I change them all out of paranoia. Your question now should be "How do I know what to change it to?", right? Very easy: take out the foundry and possibly change the weight and size. It would be easier to show you: font = "-*-tahoma-normal-r-normal-*-*-100-*-*-*-*-*-*" The easiest way to get a font that you want is to use the Text Tool (or a Script-Fu that lets you change the font), pick the font you want (with all the correct sizes, weights, and encodings) and go to the "Font Information" tab and see what it tells you. What you should see is something like: -unknown-tahoma-normal-r-normal-*-*-100-*-*-p-*-iso8859-1 Most of that, you can just discard and turn into wildcards. Just follow what I did above and you will be okay. If it doesn't work, just try copying it verbatim into the resource file and that should work. Close and reopen your GIMP and you should be good to go. 5. Conclusion You should now have fully-functioning GTK themes with visible fonts. If you have any more questions, please se the section on Contact information in Appendix A. Appendix A. About this Document A.1. Location of this Document The master version of this document is located at . The HTML version is the master copy, and all other versions are produced from it. A.2. Contact Information This document was written by Rick Osborne, . All questions and comments pertaining to this document are appreciated. A.3. Copyright Information This document is Copyright (©) Rick Osborne, 1999, and falls under the GNU Public License (GPL). Appendix B. Revisions to this Document This document is version 1.0, the original.