Next | Prev | Up | Top | Contents | Index

Listing and Viewing Fonts


Getting a List of Font Names and Font Aliases

To find out which font names and font aliases are known to the X Window System, use the command xlsfonts.For more information about that command, see the reference page xlsfonts(1). If you enter the command:

xlsfonts | more

the resulting display contains entries such as:

-adobe-courier-bold-o-normal--0-0-0-0-m-0-iso8859-1
-adobe-courier-bold-o-normal--14-100-100-100-m-90-iso8859-1
-sgi-screen-medium-r-normal--14-140-72-72-m-70-iso8859-1
screen14
The first entry is an example of a 14-part X name for an outline (scalable) font. Numeric parts of font names are set to zero for outline fonts, because those fonts can be scaled to various sizes. The second and third entries are examples of 14-part X font names for bitmap fonts, while the last entry is an alias for the third entry. An X or DPS program can get a list of available fonts by calling XListFonts() or the function XListFontsWithInfo().


Viewing Fonts

To see what a particular font looks like, use the command xfd, and specify a font name or font alias known to the X Window System by using the option -fn. For example, to display the 14-point Adobe Courier Bold font, enter:

xfd -fn -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1 
To request a Utopia Regular font scaled to the size of 28 points, enter:

xfd -fn -adobe-utopia-medium-r-normal--0-280-0-0-p-0-iso8859-1 
You can use an asterisk (*) to indicate that any value is acceptable for a part of an X font name. However, asterisks in a command must be protected from the shell with quotes. For example, enter:

xfd -fn "-*-itc bookman-demi-i-normal--11-80-100-100-p-63-iso8859-1" 
to indicate that xfd can use an ITC Bookman Demi Italic font from any foundry.

The xfd command displays all characters in a specified font, as shown in Figure 5-2.

Figure 5-2 : Sample Display From xfd To open a shell window that uses a certain font, enter:

xwsh -fn font-name


Next | Prev | Up | Top | Contents | Index