Chapter 15. Working With Fonts

This chapter describes how to work with fonts on Silicon Graphics computers. It begins with an introduction to fonts and digital typography. Then it explains which fonts are available and how to install additional fonts. It also covers how to download outline fonts in the Type 1 format to a PostScript printer.

This chapter contains these sections:

Font Basics

Fonts are collections of characters. A font contains the information about the shape, size, and position of each character in a character set. That information is needed by programs that process characters, such as editing, word-processing, desktop publishing, multimedia, titling, and prepress application programs. Almost all software components in a computer system use fonts to display messages, prompts, titles, and so forth.

Binary digits are used to represent all types of information stored in a digital computer, including fonts. Digital typography deals with the style, arrangement, and appearance of typeset matter in digital systems. If you want to use font and font metric files to correctly typeset text on a digital computer, you need to know some basics about digital typography. This section contains a brief introduction to fonts and digital typography. You may want to read a book on typography for more in-depth information.

This section covers the following topics:

Terminology

Before discussing how to use fonts, consider these terms.

Typography

Typography is the art and technique of working with type. In traditional typography, the term type refers to a piece of wood or metal with a raised image of a character or characters on its upper face. Such pieces of wood or metal are assembled into lines and pages, which are printed by a letterpress process. What typographers do with type is called typesetting or composition. Type can also refer to the images produced by using such pieces of wood or metal.

Traditional typesetting is seldom used today. In modern typography, type usually refers to the images produced on typesetting or composition systems, which do not use wooden or metal type, such as photo and digital composition systems. The typography on a digital system, such as a digital computer, is called digital typography.

Digital typography is based on a hierarchy of objects called characters, fonts, and font families (or typefaces). Numeric values or measurements related to those objects can be divided into character metrics, font metrics, and typeface metrics. Sometimes all information about a font family, or typeface, is stored in a set of font files, but sometimes metric information for a set of font files is stored in a separate file called the font metric file.

Character

A character is a graphical or mathematical representation of a glyph. Letters, digits, punctuation marks, mathematical symbols, and cursors are examples of glyphs.

Font

A font is a set of characters, that is, a set of representations of characters. In a bitmap font, the shape of each character is represented by a rectangular array of bit values, 1 or 0, forming a bitmap of the shape. In an outline font, the shape of a character is represented by a mathematical description of its outline.

A distinction exists between a base and composite font. A base font is a set of characters of the same size and style. Characters in a base font usually match one another in size, style, weight, and slant because their shape, size, position, and spacing have been carefully designed by a skilled font designer. A composite font is composed of base fonts with various attributes, for example roman and italic, or book weight and semibold.

Font Family, or Typeface

A professional font designer usually creates an entire font family, or typeface, composed of a variety of base fonts with related forms, rather than a single font. A base font family, or typeface, is a set of base fonts with the same style or design. A composite font family, or composite typeface, is composed of base font families. A base font family can consist of bitmap fonts in certain sizes, a scalable font that can be used to produce bitmap fonts in different sizes, or both.

How Resolution Affects Font Size

The images on most output devices, such as laser printers and video monitors, are created by coloring a rectangular array of small dots or pixels (picture elements). The number of dots or pixels that can be drawn per unit of length in a horizontal direction is called the horizontal resolution, while the number of pixels that can be drawn per unit of length in a vertical direction is called the vertical resolution. The most commonly used unit of measure for resolution is the number of dots per inch (dpi). Resolution is a device-dependent unit of measure.

To display the resolution of your video monitor, enter this command:

xdpyinfo | grep resol 

You should get a response similar to this:

resolution: 93x93 dots per inch 

The first number is the horizontal resolution; the second the vertical resolution.

If you draw a single character at a given resolution, the bounding box of the character is the smallest rectangle that enclose that character.

If you display all of the characters in a font in the same place (without advancing), you get a composite image of those characters. If you then draw the smallest rectangle that encloses that composite image, you have the bounding box for the font. The size of a font is usually measured in the vertical direction. That size is usually not smaller than the height of the font bounding box, but it can be greater than that height. It may include additional vertical spacing that is considered part of the font design.

Typographers use small units of measure called points to specify font size. A point is approximately equal to 1/72 of an inch. The exact value is 1/72.27 (0.013837) of an inch, or 0.351 mm.

A point is a device-independent unit of measure. Its size does not depend on the resolution of an output device. A 12-point font should have approximately the same size on different output devices, regardless of the resolution of those devices.

If the resolution of an output device is equal to 72 dots per inch (dpi), the size of a dot or pixel is approximately equal to the size of a point. If the resolution of an output device is greater than 72 dpi, the size of a dot or pixel is smaller than the size of a point, and vice versa. You can use the following formula to calculate a pixel size from a point size:

pixel-size = point-size x device-resolution / 72.27

A bitmap font is usually designed for a particular resolution. Such a font has the point size specified by its designer only when it is used on an output device whose resolution matches the resolution for which that font was designed. This is because a font designer specifies a fixed bitmap for each character. If a pixel is smaller than a point, characters will be smaller than intended, and vice versa.

Font Names

When a font is designed, it is assigned a name such as Courier Oblique. This font belongs to a font family called Courier, which includes:

  • Courier

  • Courier Bold

  • Courier Bold Oblique

  • Courier Oblique

When the PostScript page description software language was developed by Adobe Systems, the spaces embedded in font names were replaced with dashes. PostScript font names look like this:

Courier
Courier-Bold
Courier-BoldOblique
HeiseiMin-W3--Adobe-Japan1-2

The size of a font is usually not part of the name of a scalable font because it can be scaled to any size. Bitmap fonts are usually designed in specific sizes. They are referred to by names such as 12-point Courier or 10-pixel Courier Bold.

The X Consortium specified 14-part font names for the X Window System. Each name is in effect a complete description of the font.

Figure 15-1 shows an example 14-part name for a bitmap font, with each part labeled. Point sizes in X font names are specified in decipoints (tenths of a point).

Figure 15-1. X Window System Font Name Example

Figure 15-1 X Window System Font Name Example

Writing Programs That Need to Use Fonts

You can write different types of programs for Silicon Graphics computers, for example, X, Display PostScript (DPS), IRIS GL, OpenGL, and mixed-model programs. Some of your programs need fonts.

How a program accesses font files depends on the program type:

  • X programs access fonts by calling X font functions, such as XListFonts() and XLoadFont().

  • DPS programs access fonts by calling X and DPS functions, or by using PostScript.

  • IRIS GL and IRIS GL/X mixed-model programs usually access fonts by calling font management (fm) functions from the IRIS GL Font Manager library (fmenumerate() and fmfindfont(), for example).

Most fonts are installed when you install the X Window System (X11 Execution Environment). Some fonts are installed with other software components, such as DPS and IRIS Showcase. Some bitmap fonts are installed when you install a language module, such as the Japanese Language Module (JLM). Some outline fonts are installed when you install a font module, such as the Japanese Font Module (JFM). However, most fonts are shared by the X Window System, DPS (which is an extension of the X Window System), IRIS GL Font Manager, Impressario, and other software components.

To maintain compatibility and portability, it is best not to access font files directly from an application program because font formats, font names, font contents, and the location of font directories may change. Your program should use the Application Programming Interfaces (APIs) specified for the X Window System, DPS, and IRIS GL Font Manager, or call even higher level functions for the 2D and 3D text available from toolkits such as IRIS Inventor and IRIS Performer.

Using Fonts With the X Window System

This section describes how to use fonts with the X Window System. The X Window System has several font utilities. This section covers a few of the most useful utilities and includes:

For a complete description of the utilities, refer to your X Window System documentation.

Listing and Viewing Fonts

Getting a List of Font Names and Font Aliases

To find out which font names and font aliases are known to the X Window System, use the command xlsfonts.For more information about that command, see the reference page xlsfonts(1). If you enter the command:

xlsfonts | more

the resulting display contains entries such as:

-adobe-courier-bold-o-normal--0-0-0-0-m-0-iso8859-1
-adobe-courier-bold-o-normal--14-100-100-100-m-90-iso8859-1
-sgi-screen-medium-r-normal--14-140-72-72-m-70-iso8859-1
screen14

The first entry is an example of a 14-part X name for an outline (scalable) font. Numeric parts of font names are set to zero for outline fonts, because those fonts can be scaled to various sizes. The second and third entries are examples of 14-part X font names for bitmap fonts, while the last entry is an alias for the third entry. An X or DPS program can get a list of available fonts by calling XListFonts() or the function XListFontsWithInfo().

Viewing Fonts

To see what a particular font looks like, use the command xfd, and specify a font name or font alias known to the X Window System by using the option -fn. For example, to display the 14-point Adobe Courier Bold font, enter:

xfd -fn -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1 

To request a Utopia Regular font scaled to the size of 28 points, enter:

xfd -fn -adobe-utopia-medium-r-normal--0-280-0-0-p-0-iso8859-1 

You can use an asterisk (*) to indicate that any value is acceptable for a part of an X font name. However, asterisks in a command must be protected from the shell with quotes. For example, enter:

xfd -fn "-*-itc bookman-demi-i-normal--11-80-100-100-p-63-iso8859-1" 

to indicate that xfd can use an ITC Bookman Demi Italic font from any foundry.

The xfd command displays all characters in a specified font, as shown in Figure 15-2.

Figure 15-2. Sample Display From xfd

Figure 15-2 Sample Display From xfd

To open a shell window that uses a certain font, enter:

xwsh -fn font-name 

Getting the Current X Font Path

The X system locates font files along a path, similar to the execution path used to find executable files. To display the current X font path, enter this command:

xset q 

In addition to other information, the xset utility displays font path information that may look like this:

Font Path:
/usr/lib/X11/fonts/100dpi/,/usr/lib/X11/fonts/75dpi/,
/usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/Type1/,
/usr/lib/X11/fonts/Speedo/,/usr/lib/X11/fonts/CID/

The X Window System checks the resolution of your video monitor. If that resolution is closer to 75 dpi than 100 dpi, it puts the directory 75dpi ahead of the directory 100dpi in the X font path.

Changing the X Font Path

You can change the default X font path by using the option fp= on an xset command line. For example, enter:

xset fp=newpath 

This command changes the X font path to the new font path (newpath).

Installing and Adding Font and Font Metric Files

This section explains where the various types of font and font metric files are installed by default, and how you can add one of your font or font metric files to the IRIX operating system.

This section describes the following topics:

Locations of Font and Font Metric Files

By default, font and font metric files are installed in the directories listed in Table 15-1.

Table 15-1. Font and Font Metric Directories

Directory Path

Conventional Contents

/usr/lib/DPS/outline/base

Outline font files in the Adobe Type 1 format

 

/usr/lib/X11/fonts/Type1

Symbolic links to font files in /usr/lib/DPS/outline/base

/usr/lib/DPS/AFM

Adobe Font Metric (AFM) files

/usr/lib/X11/fonts/100dpi

Bitmap fonts designed for the screen resolution of 100 dpi

/usr/lib/X11/fonts/75dpi

Bitmap fonts designed for the screen resolution of 75 dpi

/usr/lib/X11/fonts/misc

Miscellaneous other bitmap fonts

/usr/lib/X11/fonts/Speedo

Outline font files in the Bitstream Speedo format

/usr/lib/X11/fonts/CID

AFM, CCM, CFM, CIDFont and CMap files for large outline fonts in the Adobe CID-keyed format

The X Window System, Display PostScript, IRIS GL Font Manager, Impressario, and other software components use the directories listed in Table 15-1 by default. The locations of font files are made known to the X Window System in two ways:

  • Within each directory specified in the X font path, a file named fonts.dir contains a directory of filenames with their corresponding 14-part font names. For example, to see the font names available in /usr/lib/X11/fonts/100dpi, use the command

    more /usr/lib/X11/fonts/100dpi/fonts.dir
    

    This file is created by mkfontdir (see the mkfontdir(1) reference page).

  • The files /usr/lib/X11/fonts/ps2xlfd_map* are used by the X Window System and the IRIS Font Manager to map PostScript names or short font names to 14-part X font names, and vice versa. The IRIS Font Manager does not use any bitmap fonts that do not have an entry in those files.

In IRIX 6.5, the twelve bitmap and outline fonts appear in the install directories:

  • Dutch 801 Roman, Dutch 801 Italic, Dutch 801 Bold, Dutch 801 Bold Italic

  • Swiss 721 Roman, Swiss 721 Italic, Swiss 721 Bold, Swiss 721 Bold Italic

  • Courier 10-Pitch Roman, Courier 10-Pitch Italic, Courier 10-Pitch Bold, and Courier 10-Pitch Bold Italic

Each font contains 1015 characters. Those characters adhere to the International Organization for Standardization ISO8859-1 through ISO8859-10 and the Minimum European Subset (MES) of ISO10646-1 or Unicode 2.0. For more information about MES, use a web browser to open http://www.indigo.ie/egt/standards/mes.html.

Swiss 721 fonts are installed when you install the subsystem x_eoe.sw.Xfonts. The rest of the fonts are in the subsystem x_eoe.sw.Xunicodefonts. The subsystem x_eoe.sw.Xfonts is installed by default, while the subsystem x_eoe.sw.Xunicodefonts is optional. The new fonts are sometimes referred to as Unicode fonts, because they include Unicode character maps, and you can use Unicode codes to access characters in those fonts.

Conventions for Bitmap Font Filenames

The names of bitmap font files are specified according to the following conventions:

  • Most filenames begin with three or four letters unique to the font family, such as cour for the Courier family, or 8x13 for a utility bitmap family.

  • When a family has different style variants such as Roman and Italic, the next character of the filename is an uppercase letter to indicate the style, for example courO for Courier Oblique, or 8x13B for a utility bold font.

  • The last two characters of the filename are two digits giving the nominal size of the font in points, as in courO18.

  • Most bitmap files are of the Portable Compiled Format (PCF) type and have the file suffix .pcf, as in courO18.pcf or 8x13B.pcf.

  • Files are compressed using the compress command (see the compress(1) reference page), and, therefore, have the terminal suffix .Z as in courO18.pcf.Z.

  • Exceptions to these conventions are names such as Swiss721-Bold--Bitstream-Unicode-0_10.pcf.Z which are bitmap fonts in the directory /usr/lib/X11/fonts/100dpi. These fonts use this format:

    CIDFontName--CMapName_PointSize.pcf.Z 
    

    where CIDFontName is the font family name, CMapName specifies the character map name, and PointSize is the nominal size of the font. These names are reserved for bitmap CID-keyed fonts.

In /usr/lib/DPS/AFM there is one font metric file per typeface. When you install a font module, such as the Japanese Font Module, metric files for CID-keyed fonts are stored in the directory /usr/lib/X11/fonts/CID/character-collection/AFM. Font metric files are primarily used by text-processing and desktop-publishing programs to, for example, generate PostScript code for a specified document.

Creating Font Aliases

If you do not want to use long X font names, you can specify shorter aliases for those names. Silicon Graphics uses a file called fonts.alias to specify short aliases for fonts. There can be a fonts.alias file in an X font directory. For example, see the file fonts.alias in the directory /usr/lib/X11/fonts/100dpi.

A typical font alias looks like this:

fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1

This associates the short alias “fixed” to the longer name that follows it. The alias file can also be used to specify alternate conventions for the component parts of a 14-part font name. For example, the following entry creates an alias that uses “regular” instead of “medium” for the weight component:

-adobe-utopia-regular-i-normal--14-100-100-100-p-74-iso8859-1
-adobe-utopia-medium-i-normal--14-100-100-100-p-74-iso8859-1

To specify your own font aliases in a font directory, store them in a file called fonts.alias.local in that directory. That way your entries do not disappear when you upgrade your system software.

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 possibly 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 Filenames”) 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 normal 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 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.

Downloading a Type 1 Font to a PostScript Printer

Some outline fonts are usually built into a PostScript printer. You can find out which fonts are known to the PostScript interpreter in your printer by sending the following file to that printer:

%!
% Produce a list of available fonts
/f 100 string def
/Times-Roman findfont 12 scalefont setfont
/y 700 def
72 y moveto
FontDirectory { 
   pop f cvs show 72 /y y 13 sub def y moveto 
} forall
showpage

Utopia fonts are not usually built into PS printers. If you try to print a document that requires a Utopia font on a PS printer that does not have that font, a warning message about the replacement of a missing font with a Courier font is sent to the file /usr/spool/lp/log on the system to which that PS printer is attached.

You can download a Type 1 font to a PS printer in either of the following two ways:

  • You can insert a Type 1 font file at the beginning of the PostScript file that needs that font. You should have a statement that starts with:

    %!
    

    Put this statement at the beginning of your PS file. If you have two such lines, delete the second one.

    When you download a font this way, the font is available only while your print job is being processed.

  • You can make a copy of a Type 1 font file, and then insert the statement:

    serverdict begin 0 exitserver 
    

    after the first group of comment statements (lines that start with %) if no password has been specified for your printer; otherwise, replace 0 in the above statement with the password for your printer. Then send the edited file to your printer.

    When you download a font this way, the warning message:

    %%[ exitserver: permanent state may be changed ]%%
    

    is sent to the file /usr/spool/lp/log on the system to which the printer is attached.

    The permanent state of the printer is not really changed. Downloaded fonts disappear when you reset the printer by switching its power off and on. If there is not enough memory for additional fonts, you receive a message about a Virtual Memory (VM) error, and the font is not downloaded.

    If you again send the program that produces a list of available fonts to your printer, you should see the PostScript names of the fonts you downloaded on that list.