Three optional tables that apply to TrueType and CFF fonts alike: PCLT
describes the font to Hewlett-Packard PCL 5 printers, meta holds tagged
metadata such as the languages a font was designed for, and MERG tells a
renderer which neighbouring glyphs must be antialiased together. All numbers are
big-endian.
PCLT
Kept for compatibility with PCL 5 printers; OpenType strongly discourages it in new fonts. The table is 54 bytes. HP’s PCL 5 Printer Language Technical Reference Manual is the authority for the codes it assigns.
| Offset | Type | Name | Description |
|---|---|---|---|
0 | uint16 × 2 | majorVersion, minorVersion | 1.0. |
4 | uint32 | fontNumber | Bit 31 clear for a vendor’s native font, set for a converted one; bits 24–30 the vendor letter (A Adobe, B Bitstream, C Agfa, H Bigelow & Holmes, L Linotype, M Monotype); bits 0–23 the vendor’s own number. |
8 | uint16 | pitch | Width of the space, in font units; monospaced fonts use it for every glyph. |
10 | uint16 | xHeight | Optical x-height. |
12 | uint16 | style | Bit fields. |
14 | uint16 | typeFamily | Bits 12–15 vendor code (below), bits 0–11 an HP-assigned family number. |
16 | uint16 | capHeight | Optical cap height (top of H). |
18 | uint16 | symbolSet | Top 11 bits a number, low 5 bits plus 64 a letter: 19U (Windows 3.1 ANSI) is 629, 9U 309, 19M (Symbol) 621, 12J (Macintosh) 394, 11J (PostScript Latin 1) 362, 10J (PostScript Standard) 330, 9J (code page 1004) 298, 7J (DeskTop) 234; 0 for unbound fonts. |
20 | int8 × 16 | typeface | ASCII name shown in the printer’s font list, such as Times New Bd. |
36 | int8 × 8 | characterComplement | One bit per symbol collection (below); bit 0 clear when glyphs are in Unicode order. |
44 | int8 × 6 | fileName | Three-letter family, a treatment letter, then 00 or a symbol set mnemonic, as TNRB00. |
50 | int8 | strokeWeight | −7 to 7, below. |
51 | int8 | widthType | −5 to 5, below. |
52 | uint8 | serifStyle | Below. |
53 | uint8 | reserved | 0. |
Codes
| Field | Values |
|---|---|
style bits 0–1, posture | 0 upright; 1 oblique or italic; 2 alternate italic (backslanted, cursive, swash); 3 reserved. |
style bits 2–4, width | 0 normal; 1 condensed; 2 compressed or extra condensed; 3 extra compressed; 4 ultra compressed; 5 reserved; 6 expanded or extended; 7 extra expanded. |
style bits 5–9, structure | 0 solid; 1 outline; 2 inline; 3 contour or edged; 4 solid with shadow; 5 outline with shadow; 6 inline with shadow; 7 contour with shadow; 8 pattern filled; 9–11 pattern filled #1 to #3; 12 pattern filled with shadow; 13–15 the same #1 to #3; 16 inverse; 17 inverse with border; 18–31 reserved. |
style bits 10–15 | Reserved. |
typeFamily vendor (bits 12–15) | 0 reserved; 1 Agfa; 2 Bitstream; 3 Linotype; 4 Monotype; 5 Adobe; 6 font repackagers; 7 vendors of unique typefaces; 8–15 reserved. |
characterComplement bits | 31 ASCII; 30 Latin 1 extensions; 29 Latin 2; 28 Latin 5; 27 desktop publishing; 26 accent extensions; 25 PCL; 24 Macintosh; 23 PostScript; 22 code page extensions. Typical values: DOS/PCL FFFFFFFF003FFFFE, Windows 3.1 ANSI FFFFFFFF37FFFFFE, Macintosh FFFFFFFF36FFFFFE, ISO 8859-1 FFFFFFFF3BFFFFFE. |
fileName treatment letter | R regular; I italic; B bold; J bold italic; D demibold; E demibold italic; K black; G black italic; L light; P light italic; C condensed; A condensed italic; F bold condensed; H bold condensed italic; S semibold; T semibold italic. |
strokeWeight | −7 ultra thin; −6 extra thin; −5 thin; −4 extra light; −3 light; −2 demilight; −1 semilight; 0 book or regular; 1 semibold; 2 demibold; 3 bold; 4 extra bold; 5 black; 6 extra black; 7 ultra black. |
widthType | −5 ultra compressed; −4 extra compressed; −3 compressed or extra condensed; −2 condensed; 0 normal; 2 expanded; 3 extra expanded. (−1, 1, 4 and 5 are in range but given no name.) |
serifStyle low 6 bits | 0 sans serif square; 1 sans serif round; 2 serif line; 3 serif triangle; 4 serif swath; 5 serif block; 6 serif bracket; 7 rounded bracket; 8 flair serif, modified sans; 9 script non-connecting; 10 script joining; 11 script calligraphic; 12 script broken letter. |
serifStyle top 2 bits | 0 reserved; 1 sans serif or monoline; 2 serif or contrasting; 3 reserved. |
meta
| Structure | Type | Name | Description |
|---|---|---|---|
| Header | uint32 | version | 1. |
uint32 | flags | 0. | |
uint32 | reserved | 0 (Apple once described it as a data offset; it is not used). | |
uint32 | dataMapsCount | Number of data maps. | |
| DataMap × count | dataMaps | Records below. | |
| DataMap | Tag | tag | Kind of metadata. |
Offset32 | dataOffset | From the start of meta. | |
uint32 | dataLength | Bytes; no padding required. |
| Tag | Meaning |
|---|---|
dlng | Design languages: the scripts and languages the font was made for. ASCII text. |
slng | Supported languages: those it can handle properly, normally the same as or more than dlng. ASCII text. Without it, software may assume dlng. |
appl, bild | Reserved, used by Apple. |
The language values are lists of ScriptLangTags separated by commas (spaces after
commas ignored). A ScriptLangTag is a BCP 47 tag that must have a language or a script
subtag (ISO 15924), and should have a script: Latn, Cyrl,
sr-Cyrl, Jpan, Kore, Hang,
Hans, Hant-HK. Zinh, Zyyy,
Zxxx and Zzzz should not be used; Zmth,
Zsym and Zsye may be. These are not OpenType layout script
tags. Only the first dlng and slng record count. Private
tags are upper-case letters and digits only.
MERG
Drawing each glyph antialiased on its own is fast, but where glyphs touch or overlap
it can leave faint seams. MERG names the pairs of glyph classes that must
be drawn together before antialiasing; all other pairs need not be. Without a
MERG table, renderers should merge everything.
| Type | Name | Description |
|---|---|---|
uint16 | version | 0. |
uint16 | mergeClassCount | Number of merge classes, n. |
Offset16 | mergeDataOffset | To the n × n bytes of merge entries: row = class of the first glyph (logical order), column = class of the second. |
uint16 | classDefCount | Number of ClassDef tables. |
Offset16 | offsetToClassDefOffsets | To an array of Offset16, each from the start of MERG to a ClassDef. |
Each glyph may be in only one class, and glyph IDs across the ClassDefs, read in order, must strictly increase, or the table is ignored. Unlisted glyphs are class 0; classes of n or more never merge.
| Mask | Name | Meaning |
|---|---|---|
0x01 | MERGE_LTR | Merge the pair in left-to-right text. |
0x02 | GROUP_LTR | Treat the pair as one unit, merging only if it later meets a glyph that needs it. |
0x04 | SECOND_IS_SUBORDINATE_LTR | The merged or grouped unit keeps the first glyph’s class (otherwise it takes the second’s). |
0x08 | reserved | 0. |
0x10 | MERGE_RTL | The same for right-to-left visual order. |
0x20 | GROUP_RTL | The same. |
0x40 | SECOND_IS_SUBORDINATE_RTL | The same. |
0x80 | reserved | 0. |
A renderer walks the glyph run keeping a current group and its class. For each next glyph it looks up the entry for (group class, next class): 0 ends the group; a merge flag adds the glyph and marks the group as needing merging; a group flag adds it without marking. After adding, the group’s class becomes the new glyph’s unless the subordinate flag is set. When a group ends, it is merged if it was marked.
Examples
Arial Bold (Arial Bold.ttf, macOS) has a 54-byte PCLT:
000A6258 00 01 00 00 4D 02 BF 36 02 39 04 26 00 00 40 DA
000A6268 05 BA 00 00 4D 20 41 72 69 61 6C 20 42 64 20 20
000A6278 20 20 20 20 FF FF FF FF 00 3F FF FE 41 52 4C 42
000A6288 30 30 03 00 40 00
Version 1.0; font number 4D02BF36: native, vendor 4D =
M (Monotype); pitch 569; x-height 1062; style 0 (solid, normal width, upright); family
40DA: vendor 4 (Monotype), family 218; cap height 1466; symbol set 0
(unbound); typeface M Arial Bd; complement FFFFFFFF003FFFFE
(the DOS/PCL set); file name ARLB00 (B for bold); stroke weight 3 (bold);
width 0; serif style 40: sans serif, square.
SF Compact (SFCompact.ttf) has a 44-byte MERG: two classes,
three ClassDefs each putting one glyph (1223, 2255, 2277) in class 1, and the merge
entries 22 00 00 11. So class 0 next to class 0 is grouped (both
directions), and two class 1 glyphs side by side must be merged.