Changing the font in Carbon Emacs
My current monospaced font of choice is Deja Vu Sans Mono. It is
pretty easy to change the default font in Carbon Emacs. It is not
so easy to change the default font on Windows- or Linux-based
Emacs22, which is the current release version. It will be
relatively straightforward in Emacs23 via the xft
package. But,
for your Mac folks out there…
Installing a Font on Mac OS X
- Download the font (Mac will accept almost any format).
-
Drag the font file into
/System/Fonts
Figure out the long name of your font face in Carbon Emacs
-
M-x
mac-font-panel-mode
. Then pick your font -
M-x
describe-font
and copy the long name.
Set the default font
There are a couple of ways to do this.
Customization
-
M-x
customize-face
RETdefault
RET - Fill in the fields of the font with the long name.
.emacs.d
file
(set-default-font "-apple-inconsolata-medium-r-normal--11-110-72-72-m-110-iso10646-1")
Monospaced fonts for the uninitiated
Programmers tend to use different fonts for code than what we see in books an on the web. Word processors typically use proportional fonts, where the horizontal space allowed for narrow letters like "l" is less than the space allowed for wide letters like "W". In code, we want the columns of each line to be aligned. So, programmers tend to use monospaced fonts, where each letter takes up the same amount of horizontal space. The most commonly known fixed width-font is Courier. Another common fixed-width font for Windows and Microsoft products in Consolas. The Code Project has an exhaustive list of monospaced fonts.
One of the key attributes to look for in a monospaced font is the distinction between the number one and the lowercase letter "l" and the number zero and the uppercase "O". When you are trying to read variable names that have mixtures of numbers and letters, you will be thankful for a font that distinguishes between these.
Labels: emacs