Changing fonts

Example of setting fonts

This section provides a comprehensive example that ties together many of the concepts and procedures discussed in this chapter.

Let's assume you are an administrator for a system whose X server and X clients are accessed by several users. Many of these users have requested a bigger default text font for the scomail client. This example explains the following:

The following steps result in a bigger text font for the scoedit client.

  1. Log into the system as root. If logging into the root account does not automatically start the X server, do so now by entering the following command at the prompt:

    startx &

  2. Before you can decide on a font to use, you need to know what kinds of fonts exist on your system. The xlsfonts client displays a list of all available fonts. At the prompt in a scoterm window, enter:

    xlsfonts | more

    You see an extensive list of fonts. For this example, let's assume the following font looks like it might be a possible choice:


  3. Run the xfd command to preview the characteristics of your font:

    xfd -fn -adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1

    You see a window that displays all of the characters of the font you specified. After some examination, you decide that you want to use this 18-point Courier font.

  4. Create an alias for your chosen font so that you do not have to type the full font name when making your font specifications. Because the font is a 75dpi font, change to the /usr/lib/X11/fonts/75dpi directory and edit fonts.alias, adding the following line to the end of the file:
       courier18   -*-courier-medium-r-*--18-*-*-*-m-*-*-*
    Notice that instead of specifying the full font name in the aliases file, you can shorten the amount of typing you need to do by using wildcard characters to replace several parts of the font name.

  5. Save and exit the fonts.alias file.

  6. Reset the X server's font database so your new alias is active:

    xset fp rehash

    You can now use the courier18 alias to specify your font change.

  7. You are ready to make the new font specification for the scomail client. Change directories to /usr/lib/X11/sco/startup and look for the file named ScoMail. This is the default resource file that you need to edit to make your font change.

  8. Open the ScoMail file for editing and search for the following line:
    This is the resource that controls the font used to display text in the scomail window.

  9. Comment out the line containing the font value for this resource so that it looks like this:
       !ScoMail*XmText*fontList: -*-courier-medium-r-*--10-*-m-*-iso8859-1
    By commenting out the default resource setting, instead of simply deleting the line, you leave yourself a safeguard. You can always return to this default if you make a mistake when setting a new font value.

  10. Now open a line immediately below the resource you just commented out and enter your new resource designation, using the courier18 alias:
       ScoMail*XmText*fontList:  courier18

  11. Save and exit the ScoMail file.

  12. Now you should verify that the new font specification works. First, you need to load the new font value into the resource database, to override the original value for this font resource. Run the following command from a scoterm window:

    xrdb -merge ScoMail

    Because you are currently located in the /usr/lib/X11/sco/startup directory, you only need to specify the name of the resource file you want to load into the resource database. If you run the xrdb command from a directory other than the one containing the modified resource file, you would need to specify the complete pathname of the file.

    When your scoterm prompt returns, run the scomail client. The font that displays in the editing window should now be large enough to satisfy your users.

Previous topic: Step 5: Resetting the font database

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003