How to Change the Font Size in an Emacs Window


1) Determine what font directories are in your font path.

% /usr/bin/X11/xset -q Keyboard Control: auto repeat: on key click percent: 0 LED mask: 00000000 auto repeating keys: ffffffffffffffff ffffffffffffffff ffffffffff07f8df ffffffffffffffff bell percent: 50 bell pitch: 400 bell duration: 100 Pointer Control: acceleration: 7 = 7 / 1 threshold: 3 Screen Saver: prefer blanking: yes allow exposures: yes timeout: 300 cycle: 300 Colors: default colormap: 0x26 BlackPixel: 0 WhitePixel: 1 Font Path: /usr/lib/X11/fonts/decwin/100dpi/,/usr/lib/X11/fonts/MIT/,/usr/lib/X11/fonts/d ecwin/75dpi/ Bug Mode: compatibility mode is enabled

2) Determine what fonts are available in the font directories accessible via your font path. For example, if you are interested in courier 14 point fonts you could use the following:

% ls /usr/lib/X11/fonts/decwin/100dpi/cour*14* /usr/lib/X11/fonts/decwin/100dpi/courier14.pcf /usr/lib/X11/fonts/decwin/100dpi/courier_bold14.pcf /usr/lib/X11/fonts/decwin/100dpi/courier_boldoblique14.pcf /usr/lib/X11/fonts/decwin/100dpi/courier_oblique14.pcf

3) Determine whether you can use a font alias, or whether you need to specify the longer font description. Alias example (Decstations) using courier14:

% grep courier14 /usr/lib/X11/fonts/decwin/100dpi/fonts.alias courier14 -adobe-courier-medium-r-normal--20-140-100-100-m-110-iso8859-1 %

=> Since there exists a font alias for courier14 you can use that. Longer font description example (NCDs) using courR14:

% grep courR14 /usr/lib/X11/ncd/fonts/pcf/100dpi/fonts.alias %

=> Since there is no font alias for courR14 you need to get the longer description for that font.

% grep courR14 /usr/lib/X11/ncd/fonts/pcf/100dpi/fonts.dir courR14.pcf -adobe-courier-medium-r-normal--20-140-100-100-m-110-iso8859-1 %

=> You will use -adobe-courier-medium-r-normal--20-140-100-100-m-110-iso8859-1 4) Change your .Xdefaults file to use the desired font.

The default setting for emacs is: emacs*Font: fixed If you can use a font alias, then your .Xdefaults would have the following: emacs*font: courier14 If you have to use the longer font description, then your .Xdefaults would have the following: emacs*font: -adobe-courier-medium-r-normal--20-140-100-100-m-110-iso8859-1

5) Update your X resource environment to include the new fonts.

% xrdb .Xdefaults

6) Run emacs. You should now be able to open an emacs window with your new chosen font!


Physics Computer Services, trouble@physics.ucsb.edu
Last Modified: November 8, 1995