afm(4) afm(4)NAME afm - Adobe POSTSCRIPT font metrics file format DESCRIPTION afm files are a standard interchange format for communicating POSTSCRIPT 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 fonts. 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 (much like in a POSTSCRIPT font dictionary). 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: EndFontMetrics 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; their meanings are described in Appendix A of the POSTSCRIPT Language Manual. All numeric values are in the (1000 unit per em) character coordinate system. January 1992 1
afm(4) afm(4)FontName string The name of the font as presented to the POSTSCRIPT 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 counterclockwise 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 2 January 1992
afm(4) afm(4)Top of capital H. XHeight number Top of lowercase x. Ascender number Top of lowercase d. Descender number Bottom of lowercase 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 of 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 POSTSCRIPT 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 POSTSCRIPT 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 entries rather than W ones. Note that keys are one letter for brevity. Here too, the set is extensible, with unknown entries ignored. (This leaves room for addition of new information, for example.) A future revision of this format will have a specification for kerning information. FILES /usr/lib/ps/*.afm AFM files in the TRANSCRIPT distribution. January 1992 3
afm(4) afm(4)SEE ALSO awk(1), sed(1) in A/UX Command Reference 4 January 1992