fixing ugly {emacs, firefox} fonts on (x)ubuntu karmic

i recently switched all my systems from running kubuntu hardy heron 08.04.02 to xubuntu karmic koala 09.101 — a rather pleasant switch over. the only thing that was bothering me was the really crappy fonts in firefox and emacs. in firefox, no matter what i configured in firefox itself or in the appearance settings dialog of xubuntu (tried both gnome-control-center and XFCE’s appearance dialog) the fonts would still be blurry and below a certain size unreadable almost. in emacs i was suffering from the blurriness plus humongous menu fonts (i am getting older, i know, but so far i don’t need that large a print, really).

after a lot of research i finally managed to track it down to the following:

  1. firefox doesn’t seem to be really interested in what the user’s desktop settings say, the only guy it will listen to is fontconfig configured via /etc/fonts/conf.d!
  2. to get rid of the blurry fonts i needed to drop the 10-hinting-{full,medium,slight}.conf from fontconfig’s /etc/fonts.conf.d directory

that fixed the blurry fonts in firefox and emacs.

to get emacs menu’s back to a more sensible size i had to edit $HOME/.emacs.d/gtkrc — changing the default face via M-x customize-face only affected the buffer and modeline fonts but not the menu itself. i’m using the DejaVu Sans fonts, so my gktrc file looks like this:

style "user-font"
{
    font_name="DejaVu Sans 8"
}
widget_class "*" style "user-font"
gtk-font-name="DejaVu Sans 8"

style "default"
{
    font_name="DejaVu Sans 8"
    bg[NORMAL] = { 1.0, 1.0, 1.0 }
}

that one fixed emacs.


  1. yes, i did try kubuntu 09.10 in the hopes that the KDE 4 gang had gotten their act together and had produced by now something as usuable (as opposed to blinky, flashy, sparkly) as KDE 3.5 — alas, that hope was in vain: a lot of the features that i’d valued in KDE 3.5 were still missing, usability was still not on par with KDE 3.5’s usability — but, hey, it’s blinky, flashy, sparkly, surely that counts for something? no, not really. i’m less interested in being an onlooker in the continuing GUI-blinky, flashy, sparkly pissing contest with windows/mac osx, and rather interested in a desktop that i can adapt to my needs without having to go on an archaeological expedition into the innards of KDE 4. sorry about that.

    and, also, yes, i know about the KDE 3.5 repo for karmic — tried that, in fact, it mostly works, but with producing “cannot contact session manager” (no matter which session manager i tried) that was no longer usable either. really sorry.