HPlogo Using the X Window System > Chapter 6 Using Fonts

Scalable Typeface Administration

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

A font administrator is anyone who has purchased a font and wants to use it on a system. Scalable typefaces, unlike the X bitmap fonts, are licensed. Read your license carefully. The font administrator is responsible for ensuring that the font is used in a legal manner. The permissions for files and directories that relate to scalable typefaces have been carefully chosen to allow you to fulfill your responsibilities.

The font administrator has three main tasks:

  • Install and delete scalable typefaces.

  • License and unlicense devices to use typefaces.

  • Add and delete character sets.

Each system is shipped with a core set of scalable typefaces installed in two different directories. Intellifont scalable typefaces from Agfa are installed in the directory /usr/lib/X11/fonts/ifo.st, and Type 1 scalable typefaces from Adobe are installed in the directory /usr/lib/X11/fonts/type1.st. You can list them by typing...

   xlsfonts -fn "*-0-0-0-0-*"

...as described earlier in this chapter.

Overview

There are four steps a font administrator must perform to make a scalable typeface ready for use. These steps are covered in more detail in the following sections.

  1. Load the typeface into a directory on the target system (“Installing and Licensing Scalable Typefaces”).

  2. Load the character set if it is not already on the system (“Adding and Removing Character Sets”). Character sets are used by several different typefaces.

  3. Run stmkdirs for that directory to notify the X server of the addition. (“Creating *.dir Files with `stmkdirs'”)

  4. Add the license to that typeface for the system (“Adding and Removing Licenses with `stlicense'”).

An example of installation and removal of a typeface and its license is presented later in this chapter.

When you install a new scalable typeface, any running font servers that are using that directory need to be told to read the directory for the new font or fonts. You can do this by entering kill -USR1 pid, where pid is the process ID of the font server. See the section on using the font server for more detailed information on font server configuration.

Installing and Licensing Scalable Typefaces

To install a scalable typeface onto a system:

  1. Decide what directory will contain the new typefaces.

    • If you use the fonts/ifo.st/ or fonts/type1.st subdirectories of /usr/lib/X11, you will have your fonts in centralized locations, but you need superuser capability to write in either of these directories.

    • If you create your own directory, you do not need superuser capability. If you create a new directory, be sure to:

      • give it the extension .st.

      • make it readable for the group bin.

      • configure the font server to include it in its font path.

  2. Create a "typefaces" subdirectory to the .st directory, if one does not already exist. Install new fonts into this directory.

    For Intellifont format fonts: 

    1. Copy the files containing the typeface into an empty temporary directory on the target file system.

    2. If your typefaces are contained on several flexible discs, load the entire contents of each disc into its own temporary directory or do these steps for each individual disc. Copy the entire contents of the disc, even if you want only one typeface from it.

      CAUTION: If you copy all the discs into one directory, some files will be overwritten.
      • For HP-UX media, copy the files directly to the temporary directory.

      • For MS-DOS media, use the doscp utility to copy the files from a flexible disc drive to the temporary directory.

      • If a PC is networked into your system, refer to the network documentation about how to copy files from the PC to the HP-UX system.

    3. Run the stload utility on each temporary directory to convert the files into the proper format and place the typeface in the permanent directory you established in step 1.

    4. If you loaded more typefaces than you wanted, remove the file(s) and run stmkdirs for that directory.

    5. Delete the temporary directories used in step 2b.

    For Type-1 format fonts: 

    NOTE: The font server can handle IBM-format Type 1 fonts, but it cannot read the Macintosh format.
    1. Copy the desired scalable font files (extensions .pfa and .pfb) from the distribution media into the typefaces subdirectory. The suffixes must be lower case; the system does not recognize .PFA or .PFB.

    2. Run stmkdirs for the typefaces subdirectory to add the new fonts to the database.

Once the file is loaded, typefaces can be made available to users through licensing. Refer to “Adding and Removing Licenses with `stlicense'”.

To delete a typeface from a system:

  1. Remove all licenses for the product, using stlicense. For example

       stlicense -pr foo -fp /home/ellen/ifo.st "*"
    

    removes all licenses to product "foo" in the specified directory.

  2. Remove the typeface files that are no longer being used (extensions .ifo, .pfa, and .pfb) from the typefaces subdirectory.

  3. Run stmkdirs in the typefaces subdirectory to update the fonts.dir file.

  4. Remove the product file from the products subdirectory.

Loading Scalable Typefaces with `stload'

Use the stload utility to load into the system Agfa fonts that have been distributed in Agfa's FAIS distribution format.

The syntax for the stload utility is:

stload [ options] [ directory\filespec]

where:

directory\filespec

Required parameter specifying the name of the directory or filespec of the data to be loaded.

-o path

The name of the directory to which the the typeface outlines should be written. If this is omitted, the default is to the /usr/lib/X11/fonts/ifo.st/typefaces file.

-fp path

The name of the base directory under which typefaces, metrics, and products directories should be used.

-p product-number

Associates a product number with the newly-loaded typeface. Although this could be anything, it should reflect the product number on the package and media. The stlicense utility requires this product number.

-list

Prints a list of the data located in directory.

-link

Make links to the original directory, rather than copies.

-sym

Make symbolic links to the original directory.

-id[,-id...]

Identifies one or more specific typefaces to be loaded.

-tfm

Updates .tfm files in the output directory.

-dos

Specifies that the typeface file is in DOS format. Normally, stload generates a typeface file in a format installed for use on HP-UX, and not available onDOS.

-d mapdir

Specifies the directory containing the symbol list map required by the -to option.

-to format

Specifies the symbol list that should be used for assigning character ID codes when loading FAIS data.

-f libname

Specifies the name of the library into which FAIS data should be loaded.

-u

Specifies that the .dir files not be updated.

-v

Specifies verbose mode.

-h

Requests help.

For example:

   stload -fp new.st -p C2054#ABA -tfm -dos -v tempdir

Creating *.dir Files with `stmkdirs'

Use the stmkdirs utility to create and maintain various configuration files that support the scalable typeface technology, including fonts.dir files, directories of character sets, and directories of metrics files.

This section describes how to use stmkdirs to maintain font directories. stmkdirs works much like mkfontdir, in that it creates the fonts.dir file containing a list of fonts in the current directory. But, stmkdirs recognizes Intellifont and Type 1 scalable fonts, while mkfontdir recognizes only bitmapped fonts. Therefore, you should use stmkdirs to build the fonts.dir file in any font directory that contains scalable fonts.

stmkdirs creates the fonts.dir file from the directory of font files.

stmkdirs [options] directory,[directory,...]

where the options are:

-tfm

For any Intellifont files in the target directories, build a TFM (Tagged Font Metrics) file in the specified destination directory.

±m

Requests that fonts.dir be generated including (+) or excluding (-) bitmap fonts.

±o

fonts.dir is generated including (+) or excluding (-) scalable fonts.

±f

fonts.dir is generated (+) including excluding (-) both scalable fonts and bitmap libraries, or not generated (-).

±c

Requests that charsets.dir be generated (+) or not generated (-).

-b

Suppresses creation of backup files.

-h

Prints help information on stout.

directory

is one or more directory names containing fonts.

For each directory listed, stmkdirs reads all the font files in that directory, putting file names and XLFD name into the fonts.dir file. Without a fonts.dir file, the the X and font servers cannot access font files in the directory.

Run stmkdirs after any fonts or charsets are added or deleted.

Adding and Removing Licenses with `stlicense'

When you purchase a scalable typeface product, you receive a license agreement, outlining by who and how the typefaces in the product may be used. For instance, the terms may be that only one printer and one display may use the typefaces.

The stlicense utility helps administer the licenses. Fonts are available only to licensed devices.

The syntax for the stlicense utility is:

stlicense [-fp directory] {-fn typeface -pr product} [±device ...]

where

-fp

The path of directories to search for the specified product or typeface. The default is /fonts/ifo.st/ in /usr/lib/X11.

-fn

The typeface being licensed. The typeface is specified as an XLFD name. You need not use the whole XLFD name, just enough to uniquely identify the typeface. A product is identified by its name or product number.

-pr

The product being licensed.

±device

The device is specified in the form: host:device. The given typeface is added to or removed from the list of typefaces licensed for this device.

The host name STSYSTEM refers to all hosts served by this typeface directory.

The device name DISPLAYS refers to all displays running on the host.

The device name PRINTERS refers to all printers connected to the host.

If the machine is not specified, the default is the machine on which stlicense is running, and the device defaults to DISPLAYS.

nothing

If no devices are given, a list of devices that have licenses for the typeface is printed on the standard output. The list is grouped by system and individual device licenses.

The built-in typefaces are licensed at installation time to all displays and printers attached to the system (STSYSTEM:DISPLAYS and STSYSTEM:PRINTERS). For example,

   stlicense -pr C2054#ABA +lj3

licenses the printer named lj3 to use the typeface product C2054#ABA. Since the machine is not specified, stlicense assumes the machine to be the one on which it is running.

   stlicense C2054#ABA -pr -laserjp +laserkb

Adding and Removing Character Sets

Many Intellifont and Type 1 scalable fonts contain many characters, and can be used to create more than one character set. For example, both Intellifont and Type 1 scalable fonts can be used to build fonts using either ISO8859 encoding or HP roman-8 encoding. This section describes the management of character sets for scalable fonts.

Administering Character Sets for Intellifont Fonts

Character set definitions are stored in the fonts/stadmin/ifo/charsets subdirectory of /usr/lib/X11. as ASCII files with the extension .sym. The charsets directory is shipped from the factory with two popular character sets definitions:

  • HP Roman 8

  • ISO 8859-1 (also known as ECMA Latin 1)

These character sets are the only ones many applications need.

The archive subdirectory contains definitions for a number of additional character sets. These include character sets popular for PCs.

To enable one of the character sets in "archive":

  1. Copy the desired character set (.sym) file from the archive subdirectory into the charsets directory. For example,

       cp /usr/lib/X11/fonts/stadmin/charsets/archive/pc8.sym ..
    

  2. Run stmkdirs in the charsets directory to update the charsets.dir file. For example,

       stmkdirs /usr/lib/X11/fonts/stadmin/charsets
    

  3. Run the following to notify the font server of the changes:

       kill -USR1 pid
    

    where pid is the process ID of the font server.

To install a character set from the Type Director/DOS product, first run stconv on the .sym file to put it into a format that can be used on your workstation.

To delete a character set:

  1. Remove the character set (.sym) file from the charsets directory. (It is still in the archive subdirectory if you need it later.)

  2. Run stmkdirs with the +c option in the charsets directory to update the charsets.dir file.

  3. Run the following to notify the font server of the changes:

       kill -USR1 pid
    

    where pid is the process ID of the font server.

Administering Character Sets for Type 1 Fonts

Character set definitions for Type 1 fonts are stored in /usr/lib/X11/fonts/stadmin/type1/charsets. Files in this directory named cp.character_set define the character mapping for the desired character set. The two files shipped in this directory, cp.iso8859 and cp.hp-roman8, define the character set mappings for ISO8859.1 and Roman-8 encoding.

To add or delete character set mappings for Type 1 fonts, you need to add or delete mapping files to this directory. The file names must be of the form cp.character_set, where character_set is the charset definition, containing one hyphen, to be used at the end of the font's XLFD name.

When a font server starts up or rereads its font directories in response to a signal, it uses the character sets defined in this directory to build its list of available font names.

Example: Installing and Licensing

This example shows installing and licensing an Intellifont typeface product called "COOOO#AAA". Path names are shown in full for clarity, you may not need to specify them in that detail. Assume that you have named a flexible disk drive device location /dev/rdsk/2s1.

"COOOO#AAA" is the product number on the box of the product. It comes on two flexible discs.

A new scalable typeface directory is to be created. It is owned by the font administrator, /home/ellen. A flexible disc drive is attached to the system at device location /dev/rdsk/2s1.

  1. Copy each of the two discs into its own temporary directory.

       mkdir /tmp/disc1
    
       insert flexible disc 1 into the drive.
    
       doscp /dev/rdsk/2s1/* /tmp/disc1
    
       mkdir /tmp/disc2
    
       insert flexible disc 2 into the drive.
    
       doscp /dev/rdsk/2s1/* /tmp/disc2
    

  2. Create a new directory for the scalable typeface and make it readable by the bin group. All other groups should have no access to the .ifo files.

       mkdir /home/ellen/new.st
    
       chacl "%.bin+r" /home/ellen/new.st
    
       mkdir /home/ellen/new.st/typefaces
    
       chacl "%.bin+r" /home/ellen/new.st/typefaces
    

  3. Load the typefaces into the new directory. Note that this example includes the creation of .tfm files. If you have applications that utilize AutoFont Support, you will need them. Otherwise, save installation time and disc space by not requesting them.

       stload -p COOOO#AAA -dos -v -fp /home/ellen/new.st -tfm /tmp/disc1
    
       stload -p COOOO#AAA -dos -v -fp /home/ellen/new.st -tfm /tmp/disc2
    

  4. Make the new files readable by the bin group.

       chacl "%.bin+r" /home/ellen/new.st/typefaces/*"
    

  5. Clean up the temporary directories.

       rmdir /tmp/disc1
    
       rmdir /tmp/disc2
    

  6. To make the fonts available to a font server, edit the font server's config file to add the new font path. For example, you can append:

       ,/home/ellen/new.st
    
    to the "catalogue =" entry in the config file. Then force the font server to reread its config file by typing:
       kill -USR1 pid
    
    where pid is the font server's process id.

  7. Before this product can be used, it must be licensed. For this example, the license in the product stipulates that the typefaces can be used for up to three printers and any number of displays connected to the system.

       stlicense -fp /home/ellen/new.st -pr COOOO#AAA +STSYSTEM:DISPLAYS \ +mysystem:laser1 +mysystem:laser2 +mysystem:laser3
    
    Notice that although the printers are listed individually, the displays are grouped by the shortcut STSYSTEM:DISPLAYS. mysystem is one of the hosts covered by STSYSTEM. If you now wanted mysystem:laser4 to be licensed, you have to remove the license for one of the other printers, since you are only allowed up to three printers.
       stlicense -fp /home/ellen/new.st -pr COOOO#AAA -mysystem:laser3 \ 
    
                                                       +mysystem:laser4
    

When the product is no longer needed, remove it from the system.

  1. Remove all licenses to the product.

       stlicense -fp /home/ellen/new.st -pr COOOO#AAA "-*"
    

  2. Remove the typeface files (.ifo). The list of files to be removed is in /home/ellen/new.st/products/COOOO#AAA.

       rm /home/ellen/new.st/typefaces/12345678.ifo
    
       rm /home/ellen/new.st/typefaces/22345678.ifo
    
       .
    
       .
    
       .
    

  3. Update the fonts.dir in the typefaces subdirectory.

       stmkdirs /home/ellen/new.st/typefaces
    

Scalable Typefaces File Structure

This section describes the default scalable font directories (font catalogs). There can be other font catalogs, but each must have the .st extension and structure described here. In addition, each must be on the font path.

The directories described here are subdirectories of /usr/lib/X11.

Scalable Font Directories

The fonts/ifo.st and fonts/type1.st are the default font catalogs. They contain typeface files, licensing, and metrics information.

Licenses Subdirectory

The licenses subdirectory contains files with licensing information for each host, display, and system.

It contains a hosts.dir file, which is a cross-reference between the actual host name and the directory containing license information about that host. One host subdirectory is STSYSTEM, which is for system-wide licenses. There are separate subdirectories for each host on the system.

Within each host subdirectory, there are subdirectories for each device (DISPLAYS is always one). Within these directories there are fonts.dir and fonts.alias files as described elsewhere in this manual.

Metrics Subdirectory

The fonts/ifo.st/metrics directory contains metrics for the fonts and scalable typefaces that are not loaded on the system. This is the recommended location for the .tfm files for Intellifont fonts, and for .afm files for Type 1 fonts.

Products Subdirectory

Each product that has been installed has a file cross-referencing the font file name and the XLFD name used to refer to it. The core fonts are in the builtin file.

Typefaces Subdirectory

The typefaces subdirectory contains the typeface files. The Intellifont files have a .ifo extension. Type 1 typeface files have a .pfa or .pfb extension. In addition, there is a fonts.dir file for each typeface directory.

Administrative Directories

The fonts/stadmin/ifo directory contains typefaces.dir, which provides a cross-reference between the typeface ID and the XLFD name for Intellifont fonts.

The fonts/stadmin/ifo/charsets subdirectory contains valid character sets for Intellifont fonts. These files have a .sym extension and are in the same format at those for TypeDirector/DOS 3.0. A charsets.dir file provides a cross-reference between the file name and the character set name. Non-active character sets are contained in the subdirectory archive, with its own charsets.dir file. To make an inactive character set active, copy it from the archive subdirectory, and update the charsets.dir file by running stmkdirs on that directory.

The fonts/stadmin/type1/charsets subdirectory contains valid character sets for Type 1 fonts. These files are all named cp.character_set, and are used to provide a mapping between internal Type 1 character names and standard encodings such as ISO8859.1 and Roman-8.

Using `stmkfont' and `stconv'

Two additional support utilities are provided for use with Intellifont outline fonts. The next two sections describe stmkfont, a utility for generating a variety of bitmap formats from Intellifont outlines, and stconv, a utility for manipulating Intellifont symbol set files.

Making Bitmapped Fonts from Scalable Typefaces with `stmkfont'

The stmkfont utility produces bitmapped fonts in a variety of formats from an outline specified by an XLFD name. stmkfont can create bitmap fonts in the following formats:

bdf

Bitmap Distribution Format

PCL

Printer Command Language (for HP LaserJet printers)

PCLEO

Printer Command Language Encapsulated Outlines (for HP LaserJet III printers).

IFO

Intellifont outline.

TFM

HP Tagged Font Metric for metrics pertaining to HP LaserJet printer scalable typefaces.

The syntax for stmkfont is:

stmkfont [options] xlfdname

where the options are:

-d1 path

Specifies the primary database tree path (default is fonts/ifo.st).

-d2 path

Specifies the secondary database tree path (default is fonts/stadmin).

-dv device

Specifies the device for which the font is to be made.

-cp path

Specifies the charset path (default is charsets).

-cf file

Specifies the charset file (default is to derive it from the XLFD name.

-nf file

Specify a new name for fonts.dir.

-ns file

Specify a new name for charsets.dir.

-nt file

Specify a new name for typefaces.dir.

-nv name

Specify an environment variable to use instead of STPATH.

-o outfile

Specifies output file (default is stdout)

-f format

Specifies the output format (BDF (default), PCL, or PCLEO).

-I

Send completion status information to stderr.

-P

Send 1% progress dots to stderr.

-C

Send catalog of XLFD/symbol set combinations to stderr.

-T

Bypass intermediate tempfile, write to output directly.

-V

Send fully qualified XLFD name to stderr, then quit.

-v

Send fully qualified XLFD name to stderr, then continue.

-w

Suppress bitmaps, restrict output to header and trailer only.

-q

Suppress error messages (quiet mode).

xlfdname

This parameter is required. Since both the XLFD name and parameters start with a dash (-), then stmkfont assumes the last arguments is the XLFD name.

The XLFD name must not contain any blanks. If it does, enclose the entire string in quotes ("). Empty fields and wildcards are permitted.

For example,

   stmkfont -o myfont "-agfa-cg century schoolbook-normal-r-normal-*--240---p-150-*-roman8"

Converting Map Formats with `stconv'

The stconv utility converts symbol set maps (.sym files) from one symbol set to another. Output is always to stdout.

The syntax for stconv is:

stconv infile [-hmq] [-d mapdir] [-to format]

where:

infile

Name of the .sym file to be converted.

-d mapdir

Specifies the name of the directory containing the symbol conversion list. This directory should contain the file acg.hpmsl and any optional additional symbol set maps. The default is fonts/stadmin/ifo/charsets in /usr/lib/X11.

-to format

Specifies the new symbol list format. The default is hpmsl. To generate a symbol set for Agfa's character codes, specify -to ACG.

-m

Lists the conversion map.

-q

Run quietly.

-h

Requests help.

For example,

   stconv -to ACG roman8.sym

reads the HPMSL symbol map roman8.sym, and writes the ACG version to stdout.

© 1995 Hewlett-Packard Development Company, L.P.