A Type 1 font program builds a PostScript dictionary and registers it as a font. The clear text part (the first segment) fills in the keys anyone may read; the encrypted part adds the Private dictionary, which holds the hints and helper routines, and the CharStrings dictionary of glyph programs. Because the program is real PostScript, a reader that does not run PostScript has to recognise these keys and their usual syntax.
First line
A conforming font starts with %!FontType1-SpecVersion:
FontName FontVersion, for example
%!FontType1-1.0: Symbol 001.003; fonts from Adobe itself use
%!PS-AdobeFont-1.0: FontName version, and
software should accept both (Type 1 specification, section 2.3). DSC comments such
as %%CreationDate and %%VMusage, the memory the font needs
once loaded, may follow.
Font dictionary
| Key | Type | Meaning |
|---|---|---|
FontType | integer | 1. |
FontName | name | The PostScript name, e.g. /Times-Roman. |
FontInfo | dictionary | Optional descriptive values, below. |
PaintType | integer | 0 the outlines are filled; 2 they are stroked. |
StrokeWidth | number | Line width for PaintType 2, in glyph units. |
FontMatrix | array of 6 | Maps glyph units to the 1-unit text space; normally [0.001 0 0 0.001 0 0], a 1000-unit em. |
Encoding | array or name | StandardEncoding, or a 256-entry array of glyph names indexed by character code (unused codes /.notdef). |
FontBBox | array of 4 | Lower-left x, y and upper-right x, y of all glyphs, in glyph units. |
UniqueID | integer | Optional number registered with Adobe so that printers can cache glyphs across jobs; 0 to 16,777,215 (224 − 1), separate for each FontType (section 2.5). |
XUID | array | Optional extended unique ID: an organisation number followed by its own numbers (defined in the PostScript Language Reference Manual, not the Type 1 book). |
Private | dictionary | Added by the encrypted part; below. |
CharStrings | dictionary | Added by the encrypted part: glyph name → charstring. Must contain /.notdef. |
Metrics, Metrics2, CDevProc | dictionaries, procedure | Optional overrides of glyph widths and side bearings, added by applications rather than font makers (Metrics appears in the Type 1 book’s figure 2b; the others are PostScript Level 2 additions). |
FSType | integer | A later addition in some fonts: the embedding permissions, as in the OS/2 table’s fsType. |
FontInfo
| Key | Type | Meaning |
|---|---|---|
version | string | Font version, e.g. (001.007). |
Notice | string | Trademark and copyright notice. |
FullName | string | Full name for menus, e.g. (Times Roman). |
FamilyName | string | Family, e.g. (Times). |
Weight | string | Weight name, e.g. (Roman), (Bold). |
ItalicAngle | number | Degrees anticlockwise from vertical; negative for fonts that lean right. |
isFixedPitch | boolean | True if every glyph has the same width. |
UnderlinePosition | number | Distance from the baseline to the underline, in glyph units (usually negative). |
UnderlineThickness | number | Underline thickness, in glyph units. |
Fonts may add other entries (Adobe’s 1990 fonts include a Copyright
string).
Private dictionary
The encrypted part starts by creating the Private dictionary. Its hint values let the rasteriser keep stems even and line up the tops and bottoms of letters at small sizes. All values are in glyph units unless stated.
| Key | Type | Meaning |
|---|---|---|
RD or -| | procedure | Reads the binary charstring that follows: {string currentfile exch readstring pop}. |
ND or |- | procedure | Defines a glyph: {noaccess def}. |
NP or | | procedure | Stores a subroutine: {noaccess put}. |
BlueValues | array, up to 14 | Required. Pairs of y values giving alignment zones: the first pair is the baseline overshoot zone, the rest zones above it (x-height, cap height, ascender…). In ascending order. |
OtherBlues | array, up to 10 | Pairs of zones below the baseline (descenders). |
FamilyBlues | array, up to 14 | The family’s regular-weight BlueValues, used at small sizes so the family aligns. |
FamilyOtherBlues | array, up to 10 | The family’s OtherBlues. |
BlueScale | number | The point size (as a ratio) below which overshoots are suppressed; default 0.039625, which is 10 points at 300 dpi (section 5.6). |
BlueShift | integer | Overshoots at least this deep are kept above the BlueScale size; default 7. |
BlueFuzz | integer | How far outside a zone an edge may be and still be aligned to it; default 1. |
StdHW | array of 1 | The dominant horizontal stem width. |
StdVW | array of 1 | The dominant vertical stem width. |
StemSnapH | array, up to 12 | Common horizontal stem widths, including StdHW, in ascending order. |
StemSnapV | array, up to 12 | Common vertical stem widths. |
ForceBold | boolean | Thicken thin stems at small sizes (for bold fonts). |
LanguageGroup | integer | 0 Latin, Greek, Cyrillic and similar; 1 Chinese, Japanese and Korean ideographs, which use different stem rules. |
ExpansionFactor | number | For LanguageGroup 1: how much a counter may grow to keep stems apart; default 0.06. |
lenIV | integer | Number of random bytes at the start of each charstring; default 4. The original LaserWriter’s interpreter (version 23.0) needs 4; otherwise 0 or 1 saves space (section 5.12). |
password | integer | Compatibility entry, required: always 5839 (section 5.13). |
MinFeature | array of 2 | Obsolete compatibility entry, required: always {16 16} (section 5.13). |
UniqueID | integer | The same value as in the font dictionary. |
RndStemUp | boolean | Superseded by LanguageGroup. A language group 1 font must also include /RndStemUp false def for older interpreters; no other font should mention it (section 5.11). |
Subrs | array | Charstring subroutines, called with callsubr; see below. |
OtherSubrs | array of procedures | PostScript procedures called from charstrings with callothersubr, for flex and hint replacement. |
Subrs, OtherSubrs and CharStrings syntax
/Subrs count array
dup 0 n RD n encrypted bytes NP
dup 1 n RD n bytes NP
…
ND
2 index /CharStrings count dict dup begin
/.notdef n RD n bytes ND
/space n RD n bytes ND
…
end
end
readonly put
noaccess put
dup /FontName get exch definefont pop
mark currentfile closefile
Each entry is a count of bytes, the RD procedure, one space and then
exactly that many bytes of encrypted charstring.
If a font uses flex or hint replacement, its first four Subrs must be these
fixed helpers (section 8.4); otherwise Subrs 0 may be an ordinary subroutine:
| Subrs | Contents | Use |
|---|---|---|
| 0 | 3 0 callothersubr pop pop setcurrentpoint return | Ends a flex sequence. |
| 1 | 0 1 callothersubr return | Starts a flex sequence. |
| 2 | 0 2 callothersubr return | Adds a point to a flex sequence. |
| 3 | return | Does nothing; called during hint replacement by interpreters without OtherSubrs 3 (see hint replacement). |
| OtherSubrs | Purpose |
|---|---|
| 0 | End of flex: draw the two curves as a flat line or as curves depending on the size. |
| 1 | Start of flex. |
| 2 | Collects one flex point. |
| 3 | Hint replacement. |
| 4 and up | Reserved by the Type 1 specification for future extensions (chapter 8). Later Adobe documents use further entries for counter control and Multiple Master fonts; those are not covered here. |
The OtherSubrs procedures themselves are a fixed block of PostScript published by Adobe, which fonts copy unchanged; interpreters such as FreeType implement their effect directly rather than running them.
Example
The clear text font dictionary of Times Roman (TIR_____.PFB, 1990),
with the long copyright strings shortened:
%!PS-AdobeFont-1.0: Times-Roman 001.007
%%CreationDate: Tue Mar 20 12:15:38 1990
%%VMusage: 30487 37379
11 dict begin
/FontInfo 10 dict dup begin
/version (001.007) readonly def
/Notice (Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. …) readonly def
/Copyright ( … ) readonly def
/FullName (Times Roman) readonly def
/FamilyName (Times) readonly def
/Weight (Roman) readonly def
/ItalicAngle 0 def
/isFixedPitch false def
/UnderlinePosition -100 def
/UnderlineThickness 50 def
end readonly def
/FontName /Times-Roman def
/Encoding StandardEncoding def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/UniqueID 28416 def
/FontBBox{-168 -218 1000 898}readonly def
currentdict end
currentfile eexec
A 1000-unit em, filled outlines, the standard Latin encoding, and glyphs reaching
from 218 units below the baseline to 898 above. Everything after
eexec is in the encrypted segment.