[Previous]   [Next]   [Contents]   [Index]   

Working with Fonts

This chapter explains how the HP X station accesses fonts and explains how you can configure the X station to download fonts using several different access mechanisms.

Topics in this chapter include:

If you experience any font problems, refer to Solving Font-Related Problems.

Which Fonts Are Available?

For a font to be available to the X server:

Understanding How the X Server Finds and Downloads Fonts

When switched on, the X station searches for fonts on its font path. Later, when specific fonts are requested, the X server knows where they are located and downloads the fonts using the preferred font access mechanism.

For information about changing your default font path, refer to Changing Your Default Font Path.

The X station can use any of three font access mechanisms:

TFTP (Trivial File Transfer Protocol)

TFTP is present on any system on which the ENWARE X station software has been installed. All Hewlett-Packard X stations can access fonts under basepath/fonts using TFTP.

NFS (Network File System)

If NFS was running on your system when you installed your X station, your X station can use NFS to download fonts. NFS can also access workstation fonts, which are found under /usr/lib/X11/fonts, and can download all fonts more quickly than TFTP.

TCP

TCP is a communication protocol that lets you access fonts from a font server on your network. A font server is shipped standard with all HP-UX 9.x and 10.x systems.

Understanding How the X Station Stores and Recalls Fonts

Topics in this section include:

Understanding Font Caching

Font caching is a performance feature that allows the X station to store frequently accessed fonts in memory rather than reload them each time they are requested. Reloading fonts can cause performance problems in certain environments, particularly if applications request large fonts (such as Japanese fonts).

If font caching is enabled (and this is the default behavior), previously requested fonts are kept in X station memory. If you need to reclaim the memory, you can clear all cached fonts by following these steps:

  1. Press and hold [F12] to access the configuration screens.

  2. Select the [Server] button.

  3. Click on the [Free Cached Fonts] button.

  4. Click on [OK].
If the X station needs more memory to satisfy a request, cached fonts are automatically released until the memory request succeeds.

Enabling/Disabling Font Caching

There are two ways you can enable or disable font caching:

  1. On the [Server] configuration screen, click on the [Font Caching] button.

  2. Edit the Font Caching variable in the remote configuration file.
Note that if you change the font caching behavior, you need to reset or reboot your X station before your change takes effect.

Understanding Glyph Caching

Glyph caching is another performance feature that increases the performance of applications that use scaled bitmap fonts or fonts from font servers. When glyph caching is enabled in the remote configuration file, the glyphs (character bitmaps) for each desired character are allocated separately as they are requested (the whole font is not read in, only the requested glyphs). Subsequent requests for glyphs in the cache can then use the same glyphs.

The default behavior enables glyph caching for 16-bit fonts only.

Controlling Glyph Caching

To control glyph caching behavior, edit the GlyphCacheMode variable in the remote configuration file. By default, the variable is set to:

GlyphCacheMode = 16 (the terminal enables glyph caching for 16-bit fonts only).

Other options include:

Glyph Caching and X Station Memory...

The memory used for cached glyphs is automatically reclaimed when:

Using Fonts from the ENWARE Software

By default, the X station can download the fonts installed from the ENWARE X station software by using TFTP (trivial file transfer protocol). When you installed the ENWARE X station software, you installed the following font directories:
Note: Do not remove misc or hp_roman8 from the font path as these directories contain fonts required by the X server and by many HP clients.

Using the Workstation's Fonts

Rather than install the fonts from the X station's software, you may decide to set up the X station to use fonts already installed on the workstation. By using workstation fonts, you can save a considerable amount of disk space.

Workstation fonts are installed in the following directories:

Some SCO workstations have fonts that are in an .snf format that the X station cannot use. However, you can compile SCO fonts in .bdf (bitmap distribution) format into the .snf format the X station uses. See Adding Fonts from Other Sources.

To use the workstation's fonts, you need to ensure:

Setting the Font Path

You can set the X server's font path from the host or from the X station's configuration screens:

Setting the Font Path from the Host

To use remote configuration to set the X station's font path:

  1. Make sure that the Remote Config Download parameter is ON (check the [Terminal] configuration screen).

  2. Edit the file basepath/config/terminalname.cfg for each X station.

  3. Uncomment the line that has the Font Path keywords and edit the font path to show the new directories.
    Note: You can also change the font path by using the xset command. Refer to the man page for xset for details.

Setting the Font Path from the Configuration Screens

To set the font path from the configuration screens:

  1. Press and hold [F12] to access the configuration screens.

  2. Click on [Server] to access the Default Font Path.

  3. Edit the path, then click on [OK].

  4. Click on [Reset] so that your changes take effect.

Whichever method you use, generally you will change a path element such as ./fonts/hp_roman8/75dpi/ to ./fonts/iso_8859.1/75dpi/ (the "." in ./fonts indicates the path relative to basepath.)

Accessing the Workstation Fonts: NFS and TFTP

If you have access to a font server, use it as the preferred method for accessing the fonts you need.

If you do not have access to a font server, use NFS rather than TFTP if possible. Before your X stations can use NFS, you need to have NFS running on the file server and you need to have your X stations configured into /etc/exports.

If NFS was running on your file server when you installed your X stations, your X stations were added to /etc/exports automatically and can access the workstation's fonts now. If you do not have NFS installed on your system, refer to the ENWARE software installation instructions to learn how to start it.

If you do not want to use NFS, you need to copy the workstation fonts to a directory under the TFTP home directory so that the X station can download these fonts using TFTP. A security feature restricts TFTP to directories under the TFTP home directory.


Note: For HP-UX 10.x systems: If you do not need to use NFS, you can edit the TFTP entry in /etc/inetd.conf.

Using Fonts from Different Computers

To use a font from a computer other than the file server, you can add the access mechanism and the computer's name to the beginning of the font path. The syntax of the font path is: /[access_mechanism]/[hostname:port]/path

where:

Example: Font Paths on Different Computers

The following paths are valid:

/tftp/25.6.6.1/usr/lib/X11/700X/fonts/misc/
/nfs/hp835-2/opt/hpxt/enware/xthome/fonts/iso_8859.1/75dpi/
//25.6.6.1/usr/lib/X11/fonts/misc/
/nfs//usr/lib/X11/fonts/iso_8859.1/75dpi/
tcp/25.6.6.1:7000

Note: If you use TFTP to download fonts, the X station reads font paths relative to its home directory (/usr/tftpdir on HP-UX 9.x systems; /tftpboot on SCO and Sun).

For HP-UX 10.x systems: A /usr/tftpdir no longer exists. Instead, you can edit the TFTP entry in /etc/inetd.conf. Refer to man tftp for details.

Symbolic links have been set up to allow NFS to access fonts using the same font path as TFTP.


Using Fonts from a Font Server

If you have a font server on your network, you can save about 600 KB of X station memory by setting your font path to use the font server. (A font server ships standard with all HP-UX 9.x and 10.x systems.) For information about setting up the font server itself, refer to the documentation that came with your host machine.

To set up your X station to use a font server, do the following:

  1. Press and hold [F12] to access the configuration screens.

  2. Click on [Server] to access the Server configuration screen.

  3. Click on lines in the Default Font Path area and use the [Backspace] key to remove all of the font path entries except /rom/fonts/default.

  4. Add a line to access the font server. The syntax is: tcp/hostname:ipportnumber[/cataloglist]

    where:

    For example: tcp/25.7.1.15:7000 (You would not normally specify a /cataloglist.)

  5. Click on [OK].

Your changes will take effect the next time you reset or reboot your X station.


Note: If you are using HP VUE, you may need to set a new HOME session after you have changed the font path to set up for the next login session.

Adding and Deleting Fonts

This section explains how you can use font utilities to add fonts from other sources such as external applications and how you can delete font files and font directories. Topics include:

Adding Fonts from Other Sources

To install new fonts not already on the workstation or installed from the ENWARE software, follow the steps listed below:

Step 1: Create a New Font Directory

To create a new directory for the fonts:

  1. Make the directory.

    Unless you use NFS, you must create the font directory under the TFTP home directory. For example:
    mkdir tftp_home_dir/usr/lib/X11/700X/fonts/app

    For security reasons, TFTP is restricted to operating in directories under the TFTP home directory.

  2. Add a fonts.alias file.

    Once you have made the font directory, add a fonts.alias file to the new directory. The fonts.alias file must contain the following line:

    FILE_NAMES_ALIASES

    This line allows files to be called by their filenames (without the .snf extension). For example, you can use courBO10 to specify the font that has the filename courBO10.snf.

Step 2: Compile the New Fonts

Because HP X stations automatically uncompress and convert the .snf (server natural format) and .scf (compressed server natural format) fonts of most other X servers, most fonts can be used as they are. However, if a font is available only in .bdf (bitmap distribution format) or SCO's .snf format, it must be compiled to an acceptable format for the X station (.snf or .pcf) before the X server can use it:

Step 3: Create a fonts.dir File

This step directs you to create a fonts.dir file so the X station can use the new font directory.

Each font directory must contain a fonts.dir file. The fonts.dir file lists all of the fonts in the directory in which it is located, and maps the font names used by clients to font files. The X station requires this map to be able to access the font files.

Once you have added fonts to a directory, you need to run the mkfontdir program to create a new fonts.dir file. The command syntax is: mkfontdir path. For example, to create a fonts.dir file for the app font directory, type:
mkfontdir basepath/fonts/app

Step 4: Change Your Font Path

In this step you change your font path to include the new font directory. The new font directory must be in the X server's font path. To add a directory to the font path:

  1. Type it into the Default Font Path on the X station's [Server] configuration screen.

  2. Click on [OK]

  3. Reset or reboot the X station so that your changes take effect.

Step 5: Check that the Font Has Been Added

In this step you check that the new fonts have been added by using xlsfonts as follows: xlsfonts fontname For example: xlsfonts *10x20*

Example: Adding a Font to a New Directory

  1. Create the basepath/fonts/app font directory.

  2. Go to the directory where the .bdf source file is located and type:

bdftosnf new.bdf > basepath/fonts/app/new.snf

  1. Create the fonts.dir file by typing:
    mkfontdir basepath/fonts/app

  2. Add app to the font path by editing the Default Font Path field on the X station's [Server] configuration screen:
    basepath/fonts/app/

  3. From a terminal emulator window, check that the font has been added by typing: xlsfonts new

Converting Sun Fonts

If you are adding a font not already found on the Sun workstation or installed from the X station's server software, you must ensure that the font is in an acceptable format and has been integrated into the structure of X server font directories.

To convert new fonts, you need to log in as superuser and to have $OPENWINHOME/bin and /usr/bin/X11/700X in your path. To check your path, use echo $PATH. If you need to set your PATH environment variable, do the following:

If the fonts that you want to add are Sun fonts in .fb format, refer to Converting .fb Fonts.

Converting .fb Fonts

Sun fonts that are in .fb format must be converted into .snf format (server natural format--a format that can be read by the X station server).

To convert Sun fonts that are in .fb format:

  1. Review the /usr/bin/X11/700X/admin/fb2snf script.

    fb2snf takes all 12 point .fb fonts from /usr/openwin/lib/fonts, converts them to .snf format, and saves them in the /usr/lib/X11/700X/fonts/Xol directory. The script also creates a fonts.alias and a fonts.dir file.

  2. Modify the fb2snf script and change the Sun font directory (INDIR), the directory of converted fonts (OUTDIR), or the font files selected (FILES), by changing the appropriate line at the beginning of the /usr/bin/X11/700X/admin/fb2snf script file. The default settings are:
    INDIR=/usr/openwin/lib/fonts        #Directory of Sun fb fonts
    OUTDIR=/usr/lib/X11/700X/fonts/Xol  #Directory of converted fonts
    FILES='[a-h]*12'                    #Selects all 12-point fonts
    

  3. Execute the script by typing:
    /usr/bin/X11/700X/admin/fb2snf
    

    The fb2snf script attempts to derive the font size from the font's name. If you experience any problems, edit the statement:

    /usr/openwin/bin/convertfont -S
    
    to change the -S command line switch to -s and specify the font size manually. For example:
    /usr/openwin/bin/convertfont -x -s12 -o /tmp/a12butto a12butto.fb
    /usr/bin/X11/700X/xtbdftosnf -t /tmp/a12butto.bdf > /tmp/a12butto.snf
    

  4. Once the script has finished, add the new font directory (OUTDIR) to the X server's font path on the X station's [Server] configuration screen and click [OK]. Your changes will take effect the next time you reset or reboot your X station.

Deleting Font Files

If you ever need to delete font files and font directories, keep in mind the following restrictions:

Example: Deleting a Font from a Directory

  1. Go to the app directory and delete old.snf

  2. Update the fonts.dir file for the app directory by typing: mkfontdir basepath/fonts/app

Solving Font-Related Problems

Topics in this section include:

Finding Fonts

When the client cannot find a font, it may stop completely or it may substitute another font.

Sometimes the substituted font does not have the same file structure as the requested font, which causes the keyboard to produce incorrect characters. Usually a client reports font substitutions in the error log (either .xsessionlog or, with TELNET, .x11startlog).

To determine which fonts exist, list the fonts.dir files in each font directory. To list fonts the X server has available, type: xlsfonts | more.

If the font you want appears in the fonts.dir files, but not in the output from xlsfonts, you should be able to get the font you want simply by changing the font path to include the directory that contains the desired fonts. Refer to Changing Your Default Font Path.

Changing Your Default Font Path

To determine the default font path, look on the X station's [Server] configuration screen. The path listed as the Default Font Path represents the path that is used by the X server when it is reset.

If you want your current font path (the font path that is active now, according to the applications you use and the fonts they require), to be the default font path, select the [Copy Current Path] button on the [Server] configuration screen.

The next time you reset or reboot your X station, the required fonts will automatically be found according to your new default font path.


[Previous]   [Next]   [Contents]   [Index]