DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Changing fonts

Specifying fonts for individual users

Individual users can use their own unique set of fonts for the Desktop and other clients. These font settings do not change the default resources that are available to other users on the system.

To change fonts for an individual user, perform the following steps.

  1. Create a file called .Xdefaults-hostname in the user's home directory.

  2. Edit the .Xdefaults-hostname file and add the new font resource specification, using the following format:

    client*resource_namefontname

    When you are finished, save your changes and exit the resource file.

  3. If you created the .Xdefaults-hostname file as root, assign the appropriate user permissions to the file:

    chown username .Xdefaults-hostname
    chgrp groupname .Xdefaults-hostname

  4. Start a Graphical Environment session.

Step 1: Creating an .Xdefaults-hostname file

Individual users can assign their own values to font resource specifications. You can either change the value of a font resource already set in the resource database, or you can set an entirely new font resource, perhaps a resource that changes only a particular aspect of a client's font usage. User-specified resources always override system defaults, allowing different users running the same clients to specify personal font preferences.

Individual resource settings are placed in a file called .Xdefaults-hostname, where hostname is the name of the host, or machine, where the client is running.

You can add an .Xdefaults-hostname file to a user's home directory in one of two ways:


NOTE: Lines in the resource files in the app-defaults directory do not always specify the client, because each file applies to only one client. If you create an .Xdefaults-hostname file by copying the relevant lines from a file in the app-defaults directory, be sure to add the client's name to the beginning of each line if it is not already there. Otherwise, the font resource specification will affect all clients.

When the user invokes a client, the X server checks to see if an .Xdefaults-hostname file exists in $HOME. If such a file does exist, the resource values specified in the user resource file take precedence over any values assigned to the same resource in the resource database.

See also:


Step 2: Setting the font resource

Font resource specifications must use the correct format:

client*resource_name: fontname

client refers to the client you want to affect. You can supply either the client's binary or class name. resource_name is the actual resource variable you want to define. You can use either the resource's class or instance name. fontname is the actual name of the font you are selecting. You can use the full font name, font name wildcards, or a font alias when setting this value.

There are two resources from which you can choose when specifying fonts:


fontList (Class: FontList)
This resource specifies the font that is used to display text. Most clients accept this resource. This resource can also be used to specify lists of fonts, to accommodate the possibility that some systems may contain a set of fonts, while other systems contain a different set. If you list multiple fonts, they must be separated by white space.

font (Class: Font)
Generally, this resource specifies the font that is used for all Desktop icon labels. Other clients may also use this resource, however fontList is used more frequently.
Whether you are replacing the font of a currently defined resource or you are adding a new, perhaps more specific, resource, the resource line should use the same format. For example, if you want to change the default font for the scocolor client so it displays larger text, the resource line would read:
   ScoColor*fontList: -adobe-helvetica-bold-r-normal--20-140-100-100-p-105-iso8859-1

See also:


Step 3: Assigning correct ownership permissions

If you generated an .Xdefaults-hostname file for a user from the root account, whether by creating the file or by copying the file from files in /usr/lib/X11/app-defaults, you must assign the file the correct ownership permissions. Run the chown command to assign the correct owner and the chgrp command to assign the correct group to the .Xdefaults-hostname file.

If you created your own .Xdefaults-hostname file, you can ignore this step. Your ownership permissions are already correct.

Step 4: Starting a Graphical Environment session

To see your new font settings, start a Graphical Environment session, either through scologin or by running startx from the command line.

Run the desired clients. When a client is started, it reads the $HOME/.Xdefaults-hostname file for your personal resource specifications. The new font settings are noted and the client's text is displayed accordingly.

If you created your own .Xdefaults-hostname file during a session, and you want the new font values applied to clients that are currently running, you need to restart the clients.

If you want the Desktop client to reflect your new font specifications, you must end your current session and then start the X server again, either by logging in through a scologin window or by running the startx script from the command line.


Next topic: Setting fonts from the command line
Previous topic: Step 3: Activating the new fonts

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