Emacs and bitstream fonts

I use emacs on Ubuntu heavily and naturally want a nice font to use. I chose to use the “bitstream vera sans mono” font. Well, easy does it: Options->Customize Emacs->Specific Face: “default”, and setting the value of “Font Family” to “bitstream-bitstream vera sans mono” and value of “Height” to “100” gave me the nice font that I wanted. “Custom” created the settings for me:

;; custom-set-faces was added by Custom — don’t edit or cut/paste it!
;; Your init file should contain only one such instance.
‘(default ((t (:inherit nil :stipple nil :background “gray12” :foreground “green” :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 117 :width normal :family “bitstream vera sans mono”)))))

I should mention that I am using the “color-scheme” package and using a nice looking color scheme. The color information probably comes from there.

But then I tried to create a new frame (C-x 5 2) and lo! the new frame had my old font. Reading the emacs faq gave the answer: I’d have to set the font again in the variable that determines the options for all new frames. So I set in my “~/.emacs”:

(setq default-frame-alist
‘((font . “-bitstream-bitstream vera sans mono-medium-r-normal–0-0-0-0-m-0-iso8859-1”)))

and new frames would now have the specified font, which happens to be the same as the original. I wonder if it is a coincidence that the size of the font in new frames and initial matches, because I have not specified the height of the font in this variable.

This seems like a ugly way: why specify the font properties in two different places? So I commented out the face created by custom, and oops! new frames would have a background of white. So I had to undo the change and let the fonts be specified in two places. But at least the initial and new frames have the same good looking font.

Post a comment or leave a trackback: Trackback URL.


  • Jeff Foster  On February 9, 2009 at 9:37 pm

    Thanks, this post helps me set up Emacs on Ubuntu 8.10 to have the nice Bitstream font!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: