4.18.2010

Fixing helvetica in Firefox - Ubuntu "karmic"

One of the things that always bugged me about linux as a desktop OS was its really ugly fonts in Firefox. I was always ashamed to admit it, I thought it was a really cheap kind of complaint. With my latest go-round with ubuntu, though, it really struck me how tiring it gets to read really bad anti-aliased fonts.

Here's what I did to get a decent experience:

First: install msttcorefonts. You gotta (begrudgingly) give it up to redmond, they make really nice fonts.

Firefox config


  • Under "Content" -> "Fonts & Colors" -> "Advanced"
    • Serif: DejaVu Serif
    • Sans-serif: DejaVu Sans
    • Monospace: Menlo (copied over from my Snow-Leopard install)
    • Uncheck the "Allow pages to choose their own fonts..."

Fontconfig stuff


One thing that didn't seem to be affected by the above was when a webpage specified "helvetica" as the font family, the ugliest anti-aliased helvetica would get picked. Following the advice here I added some xml to /etc/fonts/local.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
  <match target="pattern">
    <test qual="any" name="family">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arial</string>
    </edit>
  </match>
</fontconfig>

Then from the command-line (not sure if this was totally necessary), I ran sudo dpkg-reconfigure fontconfig and voila! firefox is no longer stabing me in the eyes with jaggies. (hooray!)