Content-type: text/html Man page of AFM


Section: Environments, Tables, and Troff Macros (7)
Updated: 19 August 1992
Index Return to Main Contents


AFM---Adobe font metrics file format  


AFM files are a standard interchange format for communicating Type 1 font metric information to people and programs. The format is ASCII encoded (for both human and machine readability), machine independent, extensible, simple to parse, and simple to generate. AFM files are available for all of Adobe Systems' POSTSCRIPT font programs.

While somewhat verbose, the format is intended to be easily parsed, with the ability for applications to quickly skip over items that are not of interest. It should be possible to create simple line-oriented parsing programs, or tools based on awk(1) or sed(1).

Each AFM file contains the information for only one font face. The file begins with global information about the font, followed by sections with character metrics. The file format is line-oriented, each line beginning with a property (key) name, followed by the values for that property. The general idea is to give key-value tuples.

The format is:

Key [value value ...]
Key names are case-sensitive. All keys beginning with a capital letter are reserved by Adobe Systems. The standard keys are detailed below, but other keys should be allowed and safely ignored by programs not recognizing them. All standard keys begin with a capital letter. User-defined nonstandard entries should begin with a lowercase letter.

The file begins with the line:

StartFontMetrics version
The version described here is 1.0. The last line of the file is:

The following global font keys are defined. Many of them are defined as in the top level or FontInfo subdictionary of a POSTSCRIPT font dictionary. All numeric values are in the (1000 unit per em) character coordinate system.

FontName string
the name of the font as presented to the findfont operator.
FullName string
the "print name" of the font.
FamilyName string
the font family name.
Weight string
the weight of the font.
ItalicAngle real
the angle (in degrees counter-clockwise from the vertical) of the dominant staffs of the font.
IsFixedPitch boolean
indicates monospaced (typewriter) fonts.
FontBBox llx lly urx ury
four integers giving the lower left corner and the upper right corner of the font bounding box. Note: the bounding box given here is that of the flattened paths, not of the Bezier curve descriptions.
UnderlinePosition number
the position (from the baseline) to place an underline.
UnderlineThickness number
thickness of an underline stroke.
Version string
font version identifier.
Notice string
font name trademark or copyright notice.
Comment string
comment strings may be ignored.
EncodingScheme string
a string indicating the default encoding vector for this font. The most common one is AdobeStandardEncoding. Special fonts may simply state "FontSpecific". In the future, other schemes may be employed.
CapHeight number
top of capital H.
XHeight number
top of lower case x.
Ascender number
top of lower case d.
Descender number
bottom of lower case p.

The individual character metrics are surrounded with the lines StartCharMetrics and EndCharMetrics and consist of a list of keys and values separated by semicolons. The characters are sorted (numeric ascending) by character code. Unencoded characters follow all the encoded ones and are distinguished by having character code -1. Each character gets one line of description. Standard keys are:

C number
decimal value of default character code (-1 if unencoded).
WX width-x
character width in x (y is 0).
W width-x width-y
character width vector.
N name
character name.
B llx lly urx ury
the character bounding box.
L successor ligature
a ligature sequence; The current character may join with the character named successor to form the character named ligature. Note that characters may have more than one such entry.

Most western language fonts have WX rather than W entries. Note that keys are one letter for brevity. Here, too, the set is extensible, with unknown entries ignored. (This leaves room for the addition of new information, for example.) A future revision of this format will have a specification for kerning information.  


AFM files in the TRANSCRIPT distribution


transcript(1), psfonts(1), awk(1), sed(1)  


Adobe Systems Incorporated  


POSTSCRIPT is a registered trademark of Adobe Systems Incorporated.
TRANSCRIPT is a trademark of Adobe Systems Incorporated.




This document was created by man2html, using the manual pages.
Time: 02:40:19 GMT, October 02, 2010