start page | rating of books | rating of authors | reviews | copyrights

Unix Power ToolsUnix Power ToolsSearch this book

5.16. The Simple Way to Pick a Font

X font names make the Rosetta Stone look like bedtime reading. Those hardy souls who want to experiment with fonts or access fonts on remote machines must take the high road and learn the X font naming conventions anyway. But if you just want to locate some fonts to use with xterm and other clients, you can use the predefined aliases for some of the constant-width fonts available on most systems.

Figure 5-2 lists the aliases for some constant-width fonts that should be appropriate for most of the standard clients, including xterm. [These "aliases" are basically font names. They aren't the same as shell aliases (Section 29.1). Also note that terminals should use constant-width fonts (where every character -- thin or wide -- occupies the same horizontal width). Constant-width fonts ensure that, for instance, the 54th character in every line of output from ls -l is always in the same horizontal position on the screen -- so columns will always be straight. -- JP] To give you an idea of the range of sizes, each alias is written in the font it identifies.

Figure 5-2

Figure 5-2. Miscellaneous fonts for xterm and other clients

In these cases, the aliases refer to the dimensions in pixels of each character in the font. (For example, "10×20" is the alias for a font with characters 10 pixels wide by 20 pixels high.) Note, however, that an alias can be virtually any character string.

The default font for many applications, including xterm, is a 6×13 pixel font that has two aliases: "fixed" and "6×13." Many users consider this font to be too small. If you have enough screen space, you might want to use the 10×20 font for xterm windows:

% xterm -fn 10x20 &

You can make this font the default for xterm by specifying it as the value for the font resource variable (Section 6.3):

XTerm*font: 10x20

Another quick way to get a list of fonts that match a given string is to use the xlsfonts program, which accepts a variety of options but may be used as simply as this:

% xlsfonts -fn \*-10-\*

This command will display all of the fonts that are 10 pixels wide. The string \*-10-\* is a wildcard expression matching any font specification containing -10-. Be sure to escape the * and ? characters when specifying a pattern on the command line, to avoid interpolation by the shell.

--VQ and SJC



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.