Introduction

OpenType fonts consist of several tables. The name table is where information about the font – such as font names, copyright notice, description, sample strings etc. – is stored. The font maker can supply this information in multiple languages, so that German users are presented with texts in German, French users with texts in French, etc.

Name records

Translations to any name table attribute can be added using name records.

In UFO fonts, name records are stored as dictionaries with the following format:

key value type description
name ID non-negative integer The name ID.
platform ID non-negative integer The platform ID.
encoding ID non-negative integer The encoding ID.
language ID non-negative integer The language ID.
string string The string value for the record.

Records should have a unique combination of nameID, platformID, encodingID and languageID. In cases where a duplicate is found, the last occurrence of the nameID, platformID, encodingID and languageID combination must be taken as the value.

Name record values

This section gives an overview of the possible values for name, platform, encoding and language IDs.

Name ID

Name IDs identify specific kinds of data stored in the OpenType name table.

The following table maps each name ID to its corresponding UFO info.plist attribute, where the default value can be found.

NID description UFO3 info attribute
0 Copyright notice copyright
1 Font Family name styleMapFamily
2 Font Subfamily name styleMapStyle
3 Unique font identifier openTypeNameUniqueID
4 Full font name created automatically
5 Version string openTypeNameVersion
6 PostScript name postscriptFontName
7 Trademark trademark
8 Manufacturer Name openTypeNameManufacturer
9 Designer openTypeNameDesigner
10 Description openTypeNameDescription
11 Vendor URL openTypeNameManufacturerURL
12 Designer URL openTypeNameDesignerURL
13 License Description openTypeNameLicense
14 License URL openTypeNameLicenseURL
15 Reserved
16 Typographic Family name openTypeNamePreferredFamilyName
17 Typographic Subfamily name openTypeNamePreferredSubfamilyName
18 Compatible full name openTypeNameCompatibleFullName
19 Sample text openTypeNameSampleText
20 PostScript unique name postscriptFontName
21 WWS Family Name openTypeNameWWSFamilyName
22 WWS Subfamily Name openTypeNameWWSSubfamilyName
23 Light Background Palette not available in UFO3
24 Dark Background Palette not available in UFO3
25 Variations PostScript Name Prefix not available in UFO3

Platform ID

Platform IDs identify the platform to which the name records applies.

PID description
0 Unicode
1 Macintosh
2 ISO (deprecated)
3 Windows
4 Custom

Encoding ID

Encoding IDs are platform-specific: the meaning of each value depends on the current platform ID.

The following table shows the recommended values for Mac and Windows platforms.

EID description
0 Mac (Roman)
1 Windows (Unicode)
  • What about Linux and other platforms?

Language ID

Language IDs identify the language in which a particular string is written.

The list of languages IDs is extensive, and depends on the platform ID. Please see the OpenType specification for all supported languages and their IDs:

Adding name records with the Font Info sheet

Name records can be edited manually in the OpenType section of the Font Info sheet.

Options

option description
click the + button add a new name record to the list
double-click individual table cells edit their content
click the - button delete the selected name record

Adding name records with a script

The following example shows how to add name records with a script.

nameRecords = [
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 1,  # Mac
    "encodingID" : 0,  # Roman
    "languageID" : 1,  # French
    "string"     : 'Voix ambiguë d’un cœur qui au zéphyr préfère les jattes de kiwi ',
  },
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 3,  # Windows
    "encodingID" : 1,  # Unicode
    "languageID" : 1,  # French
    "string"     : 'Voix ambiguë d’un cœur qui au zéphyr préfère les jattes de kiwi ',
  },
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 1,  # Mac
    "encodingID" : 0,  # Roman
    "languageID" : 2,  # German
    "string"     : 'Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.',
  },
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 3,  # Windows
    "encodingID" : 1,  # Unicode
    "languageID" : 2,  # German
    "string"     : 'Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.',
  },
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 1,  # Mac
    "encodingID" : 0,  # Roman
    "languageID" : 6,  # Spanish
    "string"     : 'Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú.',
  },
  {
    "nameID"     : 19, # openTypeNameSampleText
    "platformID" : 3,  # Windows
    "encodingID" : 1,  # Unicode
    "languageID" : 6,  # Spanish
    "string"     : 'Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú.',
  },
]

f = CurrentFont()
f.info.openTypeNameRecords = nameRecords

  • look for real-world examples among open-source fonts
Last edited on 22/01/2018