Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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:
  • 7x13
  • 7x14
  • 8x16
  • 9x15
  • 9x15bold
  • 10x20
  • 12x24
  • fg-16
  • fg-18
  • fg-25,
  • -*-fixed-bold-*-*-*-15-*-75-75-*-*-*-*
Adobe Fonts:
  • -*-courier-bold-r-*-*-14-*-*-*-*-*-*-*
  • -adobe-*-medium-r-*-14-*-m-*
  • -adobe-*-medium-r-*-18-*-m-*
  • -adobe-courier-medium-r-normal-*-14-*-*-*-m-*-iso8859-1
  • -adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*
  • -adobe-courier-bold-r-normal-*-14-100-100-100-m-90-iso8859-1
  • -adobe-courier-bold-r-normal-*-18-180-75-75-m-110-iso8859-1
Lucidasanstypewriter Fonts:
  • lucidasanstypewriter-12
  • lucidasanstypewriter-bold-14
  • lucidasanstypewriter-bold-24
  • -*-lucidatypewriter-medium-*-*-*-12-*-*-*-*-*-*-*
  • -*-lucidatypewriter-medium-*-*-*-18-*-75-75-*-*-*-*
  • -b&h-lucidatypewriter-bold-r-normal-sans-24-240-75-75-m-140-iso8859-1
After deciding upon a font, you can set it as your default by adding the following code to your .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?

This is document acjb in domain all.
Last modified on August 22, 2008.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.