Eliminating Ugly GTK Fonts

Note: this documentation is fairly old, and may not be relevant any more. I haven't seen this problem since 2005 or 2006.

Ever since a Debian 'unstable' upgrade six months ago (summer of 2003?) GTK applications have had horrible, ugly fonts. They're what you might call fuzzy, blurry, or maybe incomplete. They make everything from Gimp to Python Card applications look terrible, kind of like the something some incompetent sixth-grader might have put together by accident.

I've been at a complete loss to improve this since it started happening. I had no idea what caused it. I kept hoping that some intermediate X upgrade would fix the problem, but I had no such luck. Every so often, I dug around on Google, looking for a solution. However, I never found anything that worked.

Today (February 2004), I got lucky. I found an article entitled X Fonts Display Poorly? Not Anymore in the November 2003 issue of Linux Gazette. The author solved my problem for me. What changed was the ordering of fonts in the XF86Config-4 fonts section.

I had this originally:

   Section "Files"
      FontPath "unix/:7100"         # local font server
      # if the local font server has problems, we can fall back on these
      FontPath "/usr/lib/X11/fonts/Type1"
      FontPath "/usr/lib/X11/fonts/CID"
      FontPath "/usr/lib/X11/fonts/Speedo"
      FontPath "/usr/lib/X11/fonts/misc"
      FontPath "/usr/lib/X11/fonts/cyrillic"
      FontPath "/usr/lib/X11/fonts/100dpi"
      FontPath "/usr/lib/X11/fonts/75dpi"
   EndSection

There are two things wrong with this. First, I'm not running xfs or any other font server, so there's no need for the FontPath setting. Second, the fact that 100 DPI fonts are listed above 75 DPI fonts apparently causes a problem for GTK.

Based on the article, I change my font configuration setting to this:

   Section "Files"
       #FontPath   "unix/:7100"         # local font server
       #if the local font server has problems, we can fall back on these
       FontPath   "/usr/lib/X11/fonts/misc"
       FontPath   "/usr/lib/X11/fonts/cyrillic"
       FontPath   "/usr/lib/X11/fonts/75dpi"
       FontPath   "/usr/lib/X11/fonts/100dpi"
       FontPath   "/usr/lib/X11/fonts/Type1"
       FontPath   "/usr/lib/X11/fonts/CID"
       FontPath   "/usr/lib/X11/fonts/Speedo"
   EndSection

This completely solved my problem. Yay, Linux Gazette!

UglyGTKFonts (last edited 2010-05-28 16:50:18 by KennethPronovici)