How does Emacs under the X Window System utilize fonts?
There are two basic kinds of fonts: proportionally spaced and non-proportionally spaced. Proportionally spaced fonts look nice but are generally incompatible with Emacs. Non-proportionally spaced fonts (also called fixed width fonts) work well in Emacs. They ensure that margins line up correctly and are useful for programmers. Unfortunately, among the many fonts available in a standard X installation, only a few, such as Courier, are not proportionally spaced.
Once you've found a font you like, you need to change your
.Xresources file so that your preferences are set
automatically in future sessions.
Before you can find or examine a new font, you must first determine what fonts are available. To get a listing of all the fonts available, from the Unix prompt, enter: xlsfonts | more
Since there are so many fonts, you may wish to put the listing in a file and then examine the file. To put the listing into a file, enter: xlsfonts > emacsfonts.txt
Then, to browse the font listing, at the Unix prompt, enter: more emacsfonts.txt
You can see new fonts in Emacs by entering the font name on the
command line when you invoke Emacs. As an example, to open the file
emacsfonts.txt with a new font, enter either one of the
following two lines:
emacs -font 10x20 emacsfonts.txt
emacs -font lucidasanstypewriter-12 emacsfonts.txt
To see another font, exit Emacs and repeat the above step with a different font name.
Some non-proportionally spaced fonts that work well are:
| Fixed Fonts: |
|
| Adobe Fonts: |
|
| Lucidasanstypewriter Fonts: |
|
.Xresources file:
Emacs*font: 7x14
After making the changes, at the command line enter: xrdb ~/.Xresources
Then when you load Emacs, the new font will automatically be loaded.
Note: You also usually issue the xrdb
command upon starting an X Window System session.
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
Last modified on August 22, 2008.







