Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


Using X FONTS

You can get a list of all the available X fonts by typing:

	xlsfonts | more

Most X programs will take the "-fn" option to specify a font to use, or
you can use the "font" resource in your .Xresources file to specify a
font.  For example, "emacs -fn 9x15" would run emacs with the 9x15 font.

In addition to specifying fonts on the command line, most programs will
obey a "font" resource in your .Xresources file; for example, you could
put the line "xterm*font: 8x13" to make 8x13 your default xterm font.  See
the man page for "X" (type "man X") for more information about X
resources.

Note that emacs and xterm will only work properly using fixed-width fonts.
The commonly used fixed-width text fonts we have are:

    10x20           7x13bold
    12x24           7x14    
    5x8             8x13    
    6x10            8x13bold
    6x12            8x16    
    6x13            9x15    
    6x13bold        9x15bold
    6x9             fixed
    7x13

and all the courier fonts named as described below.

Most fonts have a really long 14-field name in the form:

	-foundry-family-weight-slant-setwidth-style-pixelSize-pointSize-\
	  Xresolution-Yresolution-spacing-averageWidth-registry-encoding

(The backslash at the end of the first line means that the whole font name
is actually one line, even though it can't be typed that way here.)  Note
that a hyphen, '-', is used as a field delimiter.  In most cases only a
subset of the fields should ever be specified explicitly, with the
remaining fields wildcarded (e.g., using an asterisk, *).  If you do use
wildcards, you should probably place the name of the font in single or
double quotes when using it from the command line.

When you specify a font name you need include only the minimum information
that is crucial to the application.  You are not required to specify a
font-specification fully -- you can leave off later hyphens and matching
wildcards (just make sure the fields you include are in the correct
position in the list).  For example, the following two specifications
identify fonts acceptably (the first identifies a 12pt Helvetica, the
second a 14pt Courier Bold Oblique):

	*-helvetica-medium-r-*-*-*-120-*
	*-courier-bold-o-*-*-*-140-*

This general form is recommended:

	*-family-weight-slant-*-*-*-pointSize-*

For more information about the various fields in X font names, see the "X
Font Name Fields" stock answer.

The actually see different fonts and be able to tailor them, use the
utility called "xfontsel".  type:

	xfontsel &

It is possible to preview a font by typing:

	xfd -fn fontname &

For more information, type any or all of the following at the athena% prompt:

	man xlsfonts
	man xfontsel
	man xfd

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.