The individual character metrics (sections 8 and 10 of Adobe Technical Note #5004) appear in the AFM file only, not in an ACFM or AMFM file.
The section is optional. It is enclosed by StartCharMetrics count and EndCharMetrics, and
the count is how many lines to expect.
A character line
Each character’s metrics are a list of keys and values separated by semicolons, on one line, for example:
C 102 ; WX 333 ; N f ; B 20 0 383 682 ; L i fi ; L l fl ;
The characters are sorted by numerically ascending character code. Characters that are not encoded follow the encoded ones and have the code -1. Byte codes for which no character is defined are not listed. Since version 3.0 a semicolon must have a space before it.
| Key | Values | Meaning |
|---|---|---|
C | integer | The decimal value of the default character code; -1 if the character is not encoded. Either C or CH is required. |
CH | hexadecimal in angle brackets | The same as C, with the code in hexadecimal, for multi-byte codes: <84AF>. |
WX, W0X | number | The character width in x for writing direction 0 (y is 0). |
W1X | number | The character width in x for writing direction 1. |
WY, W0Y | number | The width in y for writing direction 0 (x is 0). |
W1Y | number | The width in y for writing direction 1. |
W, W0 | two numbers | The width vector (x, y) for writing direction 0. |
W1 | two numbers | The width vector for writing direction 1. |
VV | two numbers | The same as the global VVector, for one character. |
N | name | The PostScript language character name. In the AFM file of a CID-keyed font it is the CID number. |
B | four numbers | The character bounding box llx lly urx ury. A character that makes no marks on the page (the space) reads B 0 0 0 0, and these values are not considered when computing the FontBBox. |
L | two names | A ligature sequence: the current character may join with the character named successor to form the character named ligature. A character can have several L entries. |
The widths are all optional in the note; a font in which every character has the same width states it once, in CharWidth in the
writing direction section, and then leaves the pitch out of the character lines
(the Ryumin-Light-V example, section 11.3).
What the viewer checks
- each value has the type of its key (integers, numbers, names, four numbers for
B), and a line hasCorCH; - the count after
StartCharMetricsequals the number of lines; - a bounding box has its lower-left corner below and left of the upper-right one;
- direction 1 widths (
W1X,W1) appear only whenMetricsSetssays direction 1 is described; - (as notes) the order of the characters, an encoded character after an unencoded one, a bounding box outside
FontBBox, a name given twice, and ligatures that name a character with no line of its own.
Composite characters
Composite characters are new characters made up of characters that already exist in the font, such as accented characters. The data appears in the AFM file
only, and is optional. The metrics of a composite character itself (width, box) are in the character metrics section. The section is enclosed by StartComposites
count and EndComposites; the count is the number of composite lines. All units are the 1000 to the em of the character coordinate system.
| Key | Values | Meaning |
|---|---|---|
CC | name, integer | The composite character’s name, and the number of parts it consists of. |
PCC | name, number, number | One of the parts: the character’s name, then the x and y displacement from the origin. |
CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 214 ;
This composite is made of the A, placed at the origin, and the acute accent, moved 195 units right and 214 up (figure 4 of the note). The viewer checks that the number of
PCC parts equals the number after the name, and notes a composite or a part that has no line in the character metrics.