Ads by Google

Monday, February 11, 2008

Good fonts for Emacs

I primarily use Win32 Emacs as I have a company issued laptop. For quite some time, I used "Courier New" as my font by setting

(set-default-font "-outline-Courier New-normal-r-normal-normal-16-120-96-96-c-100-iso8859-1")

Didn't like it much but it served my purpose and importantly being monospaced, the text alignment was clearly a big plus for my use. And on the gnu.emacs.help list there was a request for good fonts to use with Emacs.

Among the suggestions was one to use the "Bitstream Vera" fonts, which, upon use, is quite good in my opinion. Pleasing to the eye and it's pretty sharp and smooth.(To someone who doesn't know much about fonts)

Incidentally, this font is available in the cygwin install and can be easily be enabled for xterm or rxvt by setting it in the .Xdefaults file.

I later found that there was a variation of the above Vera family called DejaVu.

Installing this font is easy; Download the latest fonts version and unzip into a temporary directory. Then go to C:\Windows\fonts and chose the "Install font" from the File menu and that's it.

Use the font in Emacs by setting

(set-default-font "-outline-DejaVu Sans Mono-normal-r-normal-normal-*-*-96-96-c-*-iso8859-1")

To get the above font, use the command M-x display-fonts to list all the fonts installed on the system AND that can be seen by Emacs; plug in the font string of the font you'd like between the double quotes above.

Note it appears that Blogger seems to wrap the code around, it's all supposed to be a single line.

The Sans Mono seems to be particularly good but YMMV.