Next | Prev | Up | Top | Contents | Index

Adding Font and Font Metric Files

When you purchase a font or obtain a font that is in the public domain, you need to add that font to your system and possilby to your printer in order to use it. Adobe Systems donated bitmap, outline, and font metric files for the Utopia font family to the X Consortium. This section shows how the font and font metric files for Utopia Regular were added to the IRIX operating system. Other font and font metric files can be added in a similar way.

You need superuser privilege to make changes to X font directories. Before you make any changes to any IRIX directory, make a copy of its contents so that you can restore that directory if anything goes wrong. For example, your font files may not be in the right format, and they may interfere with the access of Silicon Graphics font files. Keep a log of the changes you make, and mention those changes when you report a problem with font files to Silicon Graphics; otherwise, it may be very difficult or impossible for other people to reproduce any problems that you might report.


Adding a Bitmap Font

The procedure in this section shows how to add Utopia Regular bitmap fonts to IRIX. Other fonts can be added in a similar way.

To add the Utopia bitmap fonts to the X Window System, Display PostScript, and IRIS GL Font Manager, follow these steps:

  1. Log in as root.

  2. Choose names for the installed bitmap files. Refer to the naming conventions for existing bitmap font files (see "Conventions for Bitmap Font File Names") and use names with a consistent format when you create new font names. For example, Adobe provided Utopia Regular bitmap font files designed for the resolutions of 100 and 75 dpi. The original names of these files were UTRG_10.bdf through UTRG_24.bdf

    Filenames closer to IRIX conventions are utopR10 through utopR24 (followed by the appropriate file suffixes).

  3. Convert files in Bitmap Distribution Format (BDF) to Portable Compiled Format (PCF) font files.

    BDF font files are text (ASCII) files. You can think of them as source font files. You can put BDF font files into an X font directory, but noormal practice is to use only binary font formats such as the PCF (.pcf) or compressed PCF format (.pcf.Z) for performance reasons.

    Use the bdftopcf command to convert a BDF font file to a PCF font file (see the bdftopcf(1) reference page). For example, Adobe provided two sets of Utopia Regular bitmap font files that were designed for the resolutions of 100 and 75 dpi. These files were in the extended Bitmap BDF 2.1 format. The original names of the bitmap files were UTRG_10.bdf through UTRG_24.bdf. One of them could be converted with the following command:

    bdftopcf -o utopR10.pcf UTRG_10.bdf

    However, you normally want to compress the PCF file as well.You can compress a PCF file by entering a command such as:

    compress utopR10.pcf

    But you could combine both steps simply as follows:

    bdftopcf UTRG_10.bdf | compress -c >utopR10.pcf.Z

  4. Move the bitmap font files to the appropriate directory, /usr/lib/X11/fonts/100dpi or /usr/lib/X11/fonts/75dpi. You can of course combine this step with the format conversion step as follows:

    bdftopcf UTRG_10.bdf | compress -c
    >/usr/lib/X11/fonts/100dpi/utopR10.pcf.Z

    You can tell the resolution for which a font was designed by the name of the directory in which the font designer stored the font files, or by the information in the header of a bitmap font file. In a BDF 2.1 font file, the horizontal and vertical resolution are specified in the X font name. They are also specified after the point size as the second and third numeric values in a SIZE entry. For example, the entry:

    SIZE 8 100 100

    within the file indicates an 8-point font that was designed for the horizontal and vertical resolution of 100 dpi.

  5. For Type 1 PostScript font families, there is one entry per font family in the file /usr/lib/X11/fonts/ps2xlfd_map. For each Japanese font family shipped by Silicon Graphics, there is an entry in the file /usr/lib/X11/fonts/ps2xlfd_map.japanese.

    When adding a new Type 1 font, insert an entry in the appropriate file for each style variation in the font family. It is not necessary to have an entry for each bitmap size. For example, the entries in ps2xlfd_map for the Utopia fonts are:

    Utopia-Bold -adobe-utopia-bold-r-normal--0-0-0-0-p-0-iso8859-1

    Utopia-BoldItalic -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1

    Utopia-Italic -adobe-utopia-medium-i-normal--0-0-0-0-p-0-iso8859-1

    Utopia-Regular -adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1

    The first field is the PostScript font name, as specified in the outline font file (see "Adding an Outline Font"). The second field is the X 14-part font name with 0 for all specific dimension values.

    When you add your own bitmap or outline fonts, put their entries in a file called /usr/lib/X11/fonts/ps2xlfd_map.local. That way your entries do not disappear when you upgrade your system software.

    Make sure that there is no overlap between your entries and the entries in other ps2xlfd_map* files.

  6. If you want to establish alias names for any of the new fonts, create or edit fonts.alias files in the appropriate directories (see "Creating Font Aliases").

  7. Invoke the mkfontdir command to rebuild the fonts.dir database in each directory where you added bitmap files. Enter the command:

    mkfontdir /usr/libX11/fonts/*dpi

    to create a new fonts.dir (fonts directory) file in the 100dpi and 75dpi directories.

  8. Use the xset command to notify the window system to rebuild its list of fonts:

    xset fp rehash

  9. To check whether the fonts you added are known to the X Window System, enter:

    xlsfonts > /tmp/fontlist

    The names of the fonts you added should appear on the list of font names and aliases produced by xlsfonts.

Bitmap fonts should now be added to the X Window System and the IRIS GL Font Manager. Since DPS needs both outline and bitmap fonts for each supported typeface, it first checks which outline fonts are stored in the directory /usr/lib/DPS/outline/base. Then it looks for the corresponding bitmap fonts in other X font directories. It ignores all other bitmap fonts. Therefore, DPS ignores the bitmap fonts you added until you add the corresponding outline fonts.


Adding an Outline Font

To add the Utopia Regular outline font to the X Window System, Display PostScript, and the IRIS GL Font Manager, follow these steps:

You can install only Adobe text (ASCII) Type 1 font files or compatibles, not binary Type 1 font files and not Type 3 font files. Display PostScript can handle Type 3 font files, but the X Window System and IRIS GL Font Manager cannot.

  1. Log in as root.

  2. Convert the file to Printer Font ASCII (PFA) format if necessary. Printer Font Binary (PFB) files are not supported. To convert .pfb files to .pfa files, use the pfb2pfa command shipped with IRIX version 5.3 and higher (see the pfb2pfa(1) reference page). For example, to convert the Adobe file UTRG____.pfb, enter

    pfb2pfa UTRG____.pfb UTRG____.pfa

  3. Look at the names of existing outline font files in the directory /usr/lib/DPS/outline/base. Display PostScript requires that the name of each outline font file match the PostScript font name specified in the /FontName entry in the header of that outline font file. For example, if you enter:

    grep /FontName Courier-Bold

    in the directory /usr/lib/DPS/outline/base, you get:

    /FontName /Courier-Bold def

    The name revealed is used for the filename of the outline font, the filename of the metric file, and in the /usr/lib/X11/fonts/ps2xlfd.map file.

    For example, Adobe provided the Utopia Regular outline font file UTRG____.pfa, which is an outline font file in the Type 1 format. To find the PostScript font name for this font, enter:

    grep /FontName UTRG____.pfa

    You should get the response:

    /FontName Utopia-Regular def

    When this font was added to IRIX, the name of the file UTRG____.pfa was changed to Utopia-Regular.

  4. Put the file Utopia-Regular in the directory /usr/lib/DPS/outline/base, because that outline font is in the Type 1 format. If you have an outline font in the Speedo format, put it in the directory:

    /usr/lib/X11/fonts/Speedo

  5. To add the Utopia Regular font and font metric files to Display PostScript, enter:

    /usr/bin/X11/makepsres -o /usr/lib/DPS/DPSFonts.upr

    /usr/lib/DPS/outline/base /usr/lib/DPS/AFM

    You should now be able to access the font file you added via Display PostScript.

  6. For most font families shipped by Silicon Graphics, there is one entry per font family in the file:

    /usr/lib/X11/fonts/ps2xlfd_map

    as described in "Adding a Bitmap Font." The same entry is used for both bitmap and outline fonts.

    If you add your own (local) bitmap or outline fonts, put an entry for each font family in the file called:

    /usr/lib/X11/fonts/ps2xlfd_map.local

    You can use entries in the file ps2xlfd_map as templates for entries in the file ps2xlfd_map.local.

    If the file ps2xlfd_map.local does not exist, log in as root, and create it.

    You can now access the font you added via the IRIS GL Font Manager.

  7. Display PostScript is an extension of the X Window System. To add an outline font in the Type 1 format to the rest of the X Window System, in any directory, enter the commands:

    type1xfonts
    xset fp rehash

    This re-creates symbolic links in the directory /usr/lib/X11/fonts/Type1 that point to outline font files in the directory /usr/lib/DPS/outline/base, and instructs the X Window System to check which fonts are available.

  8. To check whether the outline fonts you added are known to the X Window System, enter:

    xlsfonts | grep family-name

The entries for the outline fonts you added should appear on the list of font names and aliases produced by xlsfonts.

Adding of large outline fonts in the CID-keyed format is so complicated that you should contact Silicon Graphics if you want to add a font in that format. You will need to provide CIDFont and AFM files for a CID-keyed font. If existing CMap files are not sufficient, you will need to also provide one or more CMap files. Silicon Graphics will then generate CCM and CFM files from those files.


Adding a Font Metric File

Adobe Font Metric (AFM) files are primarily used by application programs--for example, to generate PostScript code for a specified document. Follow these steps to add a font metric file for an outline font in the Type 1 format:

  1. Log in as root.

  2. Put Adobe Font Metric files in the directory /usr/lib/DPS/AFM.
The name of an AFM file must match the PostScript font name as given in the file /usr/lib/X11/fonts/ps2xlfd_map (see "Locations of Font and Font Metric Files").

For example, Adobe provided the Utopia Regular font metric file UTRG____.AFM. When this font was added to IRIX, the name was changed to Utopia-Regular to correspond to the line

Utopia-Regular -adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1

in /usr/lib/X11/fonts/ps2xlfd_map.

The file was put in the directory /usr/lib/DPS/AFM.

Font metric files for a large outline font in the CID-keyed format should be put in the directory /usr/lib/X11/fonts/CID/character-collection/AFM. There is one AFM file for each CIDFont file, and one AFM file for each CID-keyed font.


Next | Prev | Up | Top | Contents | Index