The name table holds the font’s text: its family and style names, full
name, PostScript name, version, copyright, licence and so on. Each string is stored once
per platform, encoding and language, so a font can carry the same name for Mac and
Windows, and in several languages. Software finds a string by its name ID and the
platform, encoding and language it wants.
Header
| Type | Name | Description |
|---|---|---|
uint16 | version | 0 or 1. |
uint16 | count | The number of name records. |
Offset16 | storageOffset | Where the string storage starts, from the start of the table. |
NameRecord × count | nameRecord | The name records. |
uint16 | langTagCount | Version 1 only: the number of language-tag records. |
LangTagRecord × langTagCount | langTagRecord | Version 1 only: the language-tag records. |
| bytes | storage | The strings themselves. |
Name record
| Offset | Type | Name | Description |
|---|---|---|---|
0 | uint16 | platformID | The platform. |
2 | uint16 | encodingID | The platform’s encoding of the string. |
4 | uint16 | languageID | The language: a platform’s own ID below 0x8000, or a language tag from 0x8000 up. |
6 | uint16 | nameID | What the string is: see name IDs. |
8 | uint16 | length | The string’s length in bytes. |
10 | Offset16 | stringOffset | Where the string starts, from the start of the storage. |
Records are sorted by platform ID, then encoding ID, then language ID, then name ID. Strings are not terminated, and two records may share the same bytes.
Name IDs
| ID | Meaning |
|---|---|
| 0 | Copyright notice. |
| 1 | Font family name. Shared by at most four fonts that differ only in weight or slope (regular, italic, bold, bold italic), as many applications expect. Other members of a large family put the difference in this name, such as “Arial Black”, and use IDs 16 and 17 for the full family. |
| 2 | Font subfamily name: Regular, Italic, Bold or Bold Italic, matching bits 0 and 5 of OS/2 fsSelection. |
| 3 | Unique font identifier. |
| 4 | Full font name, usually IDs 1 and 2 together, or 16 and 17; Windows uses it. |
| 5 | Version string. Should start “Version ” followed by a number with a full stop, such as “Version 1.002”; each part is digits worth less than 65,535. Windows reads the font’s version from here, not from head. |
| 6 | PostScript name. At most 63 printable ASCII characters (33 to 126) except [ ] ( ) { } < > / %. |
| 7 | Trademark notice. |
| 8 | Manufacturer name. |
| 9 | Designer. |
| 10 | Description: history, features, usage notes. |
| 11 | URL of the vendor, with its protocol. |
| 12 | URL of the designer. |
| 13 | Licence description. |
| 14 | Licence information URL. |
| 15 | Reserved. |
| 16 | Typographic family name, with no limit on the number of members (formerly “preferred family”). When absent, ID 1 is the typographic family. |
| 17 | Typographic subfamily name, unique within the typographic family (formerly “preferred subfamily”). When absent, ID 2 serves. |
| 18 | Compatible full name, Macintosh only: the name for menus built from the FOND resource, when it should differ from ID 4. |
| 19 | Sample text. |
| 20 | PostScript CID findfont name. When present, ID 6 is the name to use with composefont and this one is the name for findfont. Same character rules as ID 6. |
| 21 | WWS family name: a family name that fits the weight, width and slope model, for fonts whose IDs 16 and 17 include other attributes such as optical size (“Minion Pro Caption”). Not needed when bit 8 of fsSelection is set. |
| 22 | WWS subfamily name, used with ID 21: only weight, width and slope (“Semibold Italic”). |
| 23 | Light background palette: used in CPAL palette labels to mark a palette for light backgrounds. |
| 24 | Dark background palette: marks a palette for dark backgrounds. |
| 25 | Variations PostScript name prefix: in a variable font, the family prefix for generating instance PostScript names; ASCII letters and digits only, the same in every record. |
| 26 to 255 | Reserved for future standard names. |
| 256 to 32,767 | Font-specific names, referred to from other tables: layout feature names, variation axes and instances, and so on. |
Platforms and encodings
| Platform ID | Platform | Encoding of the strings | Language IDs |
|---|---|---|---|
| 0 | Unicode | UTF-16BE. Encoding ID 3 (BMP) or 4 (full repertoire); 0, 1 and 2 are deprecated. | None defined; 0 means no particular language. Language tags allowed. |
| 1 | Macintosh | The Mac OS single- or double-byte encoding of the script in the encoding ID. | Macintosh language IDs. |
| 3 | Windows | UTF-16BE, except with encoding IDs 3, 4 and 5, which use code pages 936, 950 and 949. Unicode fonts use encoding 1, symbol fonts encoding 0; the IDs should match the font’s Windows cmap subtables (see Windows encodings). | Windows LCIDs. |
Platforms 2 and 4 are defined only for cmap. Some old Traditional
Chinese fonts, such as one in the Traditional Chinese edition of Windows 95, have
Big5 records whose subfamily string is in UTF-16BE; Windows GDI accepts that.
Macintosh encoding IDs (Script Manager codes)
Used in both name and cmap.
| ID | Script | ID | Script |
|---|---|---|---|
| 0 | Roman | 17 | Malayalam |
| 1 | Japanese | 18 | Sinhalese |
| 2 | Chinese (Traditional) | 19 | Burmese |
| 3 | Korean | 20 | Khmer |
| 4 | Arabic | 21 | Thai |
| 5 | Hebrew | 22 | Laotian |
| 6 | Greek | 23 | Georgian |
| 7 | Russian | 24 | Armenian |
| 8 | RSymbol | 25 | Chinese (Simplified) |
| 9 | Devanagari | 26 | Tibetan |
| 10 | Gurmukhi | 27 | Mongolian |
| 11 | Gujarati | 28 | Geez |
| 12 | Odia | 29 | Slavic |
| 13 | Bangla | 30 | Vietnamese |
| 14 | Tamil | 31 | Sindhi |
| 15 | Telugu | 32 | Uninterpreted |
| 16 | Kannada |
Macintosh language IDs
From Apple’s TrueType Reference Manual. IDs 95 to 127 are not assigned. In a
cmap subtable the language field is the ID plus 1.
| ID | Language | ID | Language | ID | Language |
|---|---|---|---|---|---|
| 0 | English | 51 | Armenian | 89 | Swahili |
| 1 | French | 52 | Georgian | 90 | Kinyarwanda/Ruanda |
| 2 | German | 53 | Moldavian | 91 | Rundi |
| 3 | Italian | 54 | Kirghiz | 92 | Nyanja/Chewa |
| 4 | Dutch | 55 | Tajiki | 93 | Malagasy |
| 5 | Swedish | 56 | Turkmen | 94 | Esperanto |
| 6 | Spanish | 57 | Mongolian (Mongolian script) | 128 | Welsh |
| 7 | Danish | 58 | Mongolian (Cyrillic script) | 129 | Basque |
| 8 | Portuguese | 59 | Pashto | 130 | Catalan |
| 9 | Norwegian | 60 | Kurdish | 131 | Latin |
| 10 | Hebrew | 61 | Kashmiri | 132 | Quechua |
| 11 | Japanese | 62 | Sindhi | 133 | Guarani |
| 12 | Arabic | 63 | Tibetan | 134 | Aymara |
| 13 | Finnish | 64 | Nepali | 135 | Tatar |
| 14 | Greek | 65 | Sanskrit | 136 | Uighur |
| 15 | Icelandic | 66 | Marathi | 137 | Dzongkha |
| 16 | Maltese | 67 | Bengali | 138 | Javanese (Roman script) |
| 17 | Turkish | 68 | Assamese | 139 | Sundanese (Roman script) |
| 18 | Croatian | 69 | Gujarati | 140 | Galician |
| 19 | Chinese (Traditional) | 70 | Punjabi | 141 | Afrikaans |
| 20 | Urdu | 71 | Oriya | 142 | Breton |
| 21 | Hindi | 72 | Malayalam | 143 | Inuktitut |
| 22 | Thai | 73 | Kannada | 144 | Scottish Gaelic |
| 23 | Korean | 74 | Tamil | 145 | Manx Gaelic |
| 24 | Lithuanian | 75 | Telugu | 146 | Irish Gaelic (with dot above) |
| 25 | Polish | 76 | Sinhalese | 147 | Tongan |
| 26 | Hungarian | 77 | Burmese | 148 | Greek (polytonic) |
| 27 | Estonian | 78 | Khmer | 149 | Greenlandic |
| 28 | Latvian | 79 | Lao | 150 | Azerbaijani (Roman script) |
| 29 | Sami | 80 | Vietnamese | ||
| 30 | Faroese | 81 | Indonesian | ||
| 31 | Farsi/Persian | 82 | Tagalog | ||
| 32 | Russian | 83 | Malay (Roman script) | ||
| 33 | Chinese (Simplified) | 84 | Malay (Arabic script) | ||
| 34 | Flemish | 85 | Amharic | ||
| 35 | Irish Gaelic | 86 | Tigrinya | ||
| 36 | Albanian | 87 | Galla | ||
| 37 | Romanian | 88 | Somali | ||
| 38 | Czech | ||||
| 39 | Slovak | ||||
| 40 | Slovenian | ||||
| 41 | Yiddish | ||||
| 42 | Serbian | ||||
| 43 | Macedonian | ||||
| 44 | Bulgarian | ||||
| 45 | Ukrainian | ||||
| 46 | Byelorussian | ||||
| 47 | Uzbek | ||||
| 48 | Kazakh | ||||
| 49 | Azerbaijani (Cyrillic script) | ||||
| 50 | Azerbaijani (Arabic script) |
Windows language IDs
Windows records use Windows language code identifiers (LCIDs). OpenType no longer lists them itself but points to Microsoft’s [MS-LCID] reference, which gives several hundred, each with its BCP 47 tag; this site does not repeat that list. In the 16-bit value, the low 10 bits are the primary language and the top 6 bits the sublanguage, usually a country. Common ones in fonts:
| LCID | Language | LCID | Language |
|---|---|---|---|
0x0409 | English (United States) | 0x0411 | Japanese |
0x0809 | English (United Kingdom) | 0x0412 | Korean |
0x0407 | German (Germany) | 0x0804 | Chinese (PRC) |
0x040C | French (France) | 0x0404 | Chinese (Taiwan) |
0x0C0A | Spanish (Spain, modern sort) | 0x0419 | Russian |
0x0410 | Italian (Italy) | 0x0408 | Greek |
Example
The name table of KaTeX’s Size2 Regular font: version 0, 9 records,
storage at offset 114 (6 + 9 × 12). Every record is Windows, Unicode BMP, English
(United States): platform 3, encoding 1, language 0x0409.
00000000 00 00 00 09 00 72 header
00000006 00 03 00 01 04 09 00 00 00 A2 00 00 ID 0, 162 bytes at 0
00000012 00 03 00 01 04 09 00 01 00 16 00 A2 ID 1, 22 bytes at 162
| Name ID | Length | Offset | String (UTF-16BE) |
|---|---|---|---|
| 0 | 162 | 0 | Copyright (c) 2009-2010 Design Science, Inc. … |
| 1 | 22 | 162 | KaTeX_Size2 |
| 2 | 14 | 184 | Regular |
| 3 | 70 | 198 | (unique identifier) |
| 4 | 38 | 268 | KaTeX_Size2-Regular |
| 5 | 66 | 306 | Version 1.1; ttfautohint (v1.8.3) |
| 6 | 38 | 268 | KaTeX_Size2-Regular: the same bytes as ID 4 |
| 13 | 614 | 372 | (licence) |
| 14 | 52 | 986 | (licence URL) |
The records for IDs 4 and 6 point at the same 38 bytes, since the full name and
PostScript name are the same here. “KaTeX_Size2” is stored as
00 4B 00 61 00 54 00 65 00 58 00 5F …; a Macintosh Roman record would
hold it in single bytes, 4B 61 54 65 58 5F ….