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!)

4.17.2010

Debian maintainers need to take it easy

Recently, I started using Ubuntu again (there was a spare Thinkpad-T61 in the office), and I've found that once again, debian's psychotic need to break things into micro-sized packages has bitten me in the ass.

For the longest time I've used mrxvt as my primary terminal emulator. It's got 256 colors, tabs, a cool little feature that lets you edit the scrollback in Vim, and most importantly, it renders the jmk-neep-8 font that I have an unnatural obsession with. The problem has always been that on debian, the terminfo entries for mrxvt (and quite a number of other terminals) were never present. Now I've found the answer: the "ncurses-term" package. Why debian doesn't install the rxvt-256color termcap is a mystery to me. Basically I do this to get 256 color vim by default:

if [[ "$(uname -s)" == "Linux" ]]; then
  if [[ -e /usr/share/terminfo/r/rxvt-256color && \
             "$COLORTERM" == "rxvt-xpm" ]]; then
    export TERM="rxvt-256color"
  fi
fi

Then in .vimrc:

if $TERM =~ '\(rxvt\|xterm\)-256color\|screen-bce'
  set t_Co=256
  colorscheme desert256
endif

And magic! A wonderful 256 color experience in the terminal, using bitmapped fonts on the best linux distro (as God intended).

</rant>