7.2. Changing the Xterm Font

Getting and installing these fonts can be a somewhat involved process. If you're fortunate, the fonts are available in package that your package management system knows about (with Debian a good example - and one I recommend - is "xfonts-terminus").

If you want to install fonts by hand, follow this procedure. First, retrieve the font(s). Next, ensure they're .pcf or .pcf.gz files. If they're .bdf files, investigate the "bdftopcf" command (ie. read the man page). Drop the .pcf or .pcf.gz files into the /usr/share/fonts/X11/misc dir. This was the correct directory for Debian as of 2009 but for many years prior and on other distros it was often /usr/X11R6/lib/X11/fonts/misc. It may be different on other distributions - if your system has the locate command, try running locate fonts.alias and looking for "misc" in the resulting list. cd to that directory, and run mkfontdir. Then run xset fp rehash and/or restart your X font server, whichever applies to your situation. Sometimes it's a good idea to go into the fonts.alias file in the same directory, and create shorter alias names for the fonts.

To use the new fonts, you start your X terminal program of choice with the appropriate command line parameter, which can be found either in the man page or by using the "--help" parameter on the command line. Popular terms would be used as follows:

xterm -font <fontname>


xterm -fn <fontname> -fb <fontname-bold>
Eterm -F <fontname>
rxvt -fn <fontname>
aterm -fn <fontname>

VGA fonts are available from my website at http://www.gilesorr.com/bashprompt/xfonts/. I would strongly recommend against using these, and include them mostly for historical interest. With better support for line draw characters already described previously, there's no longer a reason to use these old fonts.

One useful application for checking out fonts is xfontsel. It's not overly intuitive, but it does let you see what the font looks like - including its entire character set. Look particularly at the font family ("fmly") and the pixel size ("pxlsz"). As you change these, xfontsel generates a usable (although awkward) font string. For example:

aterm -fn -*-terminus-*-*-*-*-32-*-*-*-*-*-*-*


rxvt -fn "-*-courier 10 pitch-medium-r-*-*-17-*-*-*-*-*-iso8859-*"

Note that, as usual, quotes are needed if there are embedded spaces in the name. You can set up aliases aliases in the fonts.alias file.

Obviously this is much shorter and easier to work with, but you'll have to dig through the fonts.alias file(s) to determine what alias your system has assigned the font you're interested in, and/or create your own.