CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

next up previous
Next: Reading UNIX Man Pages Up: Desktop Computing Previous: NETSCAPE/UNIX News

Changing X Fonts

  Lionel Cons CN/DCI

With more and more people using the X Window system (from X terminals, workstations, PCs with X emulation...), it's obvious that the default fonts on the central servers like cernsp or hpplus cannot please all the users. Here is a simple cookbook to allow you to change the fonts that you use.

For more information, please surf the Web starting at:

http://wwwinfo.cern.ch/umtf/working-groups/X11/fonts/

Finding a nice font

It's sometimes hard to choose a font among the hundreds of names available. You may follow this recipe:

  1. Decide whether or not you need a mono-spaced font (i.e. all characters have the same width).
  2. Decide which slant (i.e. orientation) you want, normally either roman (upright) or italic.
  3. Choose a size in pixels, for instance 14.
  4. Find all the fonts matching your criteria (here `r' is for roman and `m' for mono-spaced) with command xlsfonts (1).
  5. Try them one by one, for instance with xterm or xfd (2).

         (1)  xlsfonts -fn '-*-*-*-r-*-*-14-*-*-*-m-*-*-*'
              -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1
              -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1
              -adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1
              -adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1
              -b&h-lucidatypewriter-bold-r-normal-sans-14-100-100-100-m-80-iso8859-1
              -b&h-lucidatypewriter-bold-r-normal-sans-14-140-75-75-m-90-iso8859-1
              -b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1
              -b&h-lucidatypewriter-medium-r-normal-sans-14-140-75-75-m-90-iso8859-1
              -bitstream-courier-bold-r-normal--14-0-75-75-m-0-iso8859-1
              -bitstream-courier-medium-r-normal--14-0-75-75-m-0-iso8859-1

         (2)  xterm -fn '-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1'

Alternatively, you can use the program xfontsel to select a font interactively.

Using It

Some applications don't allow you to change the fonts they use; the only thing that you can do is to complain to the author! The others should document how to change their fonts, usually in their man pages. For instance, the xterm man page contains:

-fn font
        This option specifies the font to be 
        used for displaying normal text.  
        The default is fixed.

and

RESOURCES
     The program understands all of the core 
     X Toolkit resource names and classes as 
     well as:
[...]
     font (class Font)
             Specifies the name of the normal 
             font.  The default is ``fixed.''

If you want your application to use the new font only once, you should use the command line option (e.g. `xterm -fn 9x15'). Otherwise, you should modify your X resources. This is described in details in the ``Guide for the Usage of X Window at CERN''. Here are some rough indications:

-
Edit your X resource file, usually  /.hepix/xresources or  /.Xdefaults.
-
Check all the lines containing `font'.
-
To change for one application only, use something like:

XTerm*Font: 9x15

-
To change for all your application, use something like:

*Font: 9x15

-
Load your new resources in your Xserver with the command `xrdb -merge ~/.hepix/xresources'.


next up previous
Next: Reading UNIX Man Pages Up: Desktop Computing Previous: NETSCAPE/UNIX News

Michel Goossens
CN Division
Tel. 3363
Thu May 30 20:08:07 METDST 1996