Skip to content

Instantly share code, notes, and snippets.

@typoman
Last active February 8, 2024 09:16
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typoman/9c264ccd0f5fd31e71be16b5cff725bf to your computer and use it in GitHub Desktop.
Save typoman/9c264ccd0f5fd31e71be16b5cff725bf to your computer and use it in GitHub Desktop.

OpenType font name table notes

Provided are the name table record ID and instructions on how to fill it out. Arial is used as an example to show how the names records can be filled. You can see the example records here:

https://learn.microsoft.com/en-us/typography/opentype/spec/namesmp

There are also more exmaples added to the bottom of this file.

Why this document?

I had my fonts compiled using fontmake (version 3.5.1) and one of the weights was not showing up in Microsoft Word font menu in Windows 10. Be aware that fontmake, RF and AFDKO compile the table name records differently and this could change how the fonts show up in MS Word.

Terminolgy

RBIBI

A font set which contains Regular, Bold, Italic and Bold Italic or a subset of these. These fonts are style linked in some apps so when a user hits a Bold or Italic button, the style switches to an appropiate font. A large font family could have multiple RBIBI font sets.

WWS

Stands for Weight, Width, Slope. Any font family that doesn't fit in one RBIBI set or has styles other than what is described in RBIBI category.

TLDR

fontmake

If you're using fontmake and your compiled ufo is not showing up in Micorsoft Word, it's proabably because your fonts don't fit in a RBIBI model. To fix that you need to add a ufo.info.styleMapFamilyName to the font that is not showing up and change the styleMapStyleName to Regular or Italic. You also need to fill the font info attributes openTypeNamePreferredFamilyName and openTypeNamePreferredSubfamilyName. See the below instructions on how to do it.

Name ID reocrds instructions

ID 1 - Font Family name (fontmake: ufo.info.styleMapFamilyName)

  • Seperates the Fonts in Microsoft Word Menu
  • Any Font Family in ID 1 should only contain max 4 styles which conform to RBIBI. For example, the Font Family name for the Arial Narrow font is Arial Narrow; the Font Family name for the Arial Black font is Arial Black. In such cases (a WWS font family), name ID 16 should also be included with a shared name that reflects the full, typographic family (in this example case the name ID 16 is Arial).
  • If any font in a family doesn't fit in RBIBI model, this record should also include the style name and ID 2 set to Regular. Then record ID 16 should only contain the family name and ID 17 should only contain the style name. An example is Source Serif 4 Display ExtraLight in which ID 1 is Source Serif 4 Display ExtraLight and ID 2 is Regular (see the example table at the end of this file).

ID 2 - Font Subfamily name (fontmake: ufo.info.styleMapStyleName)

  • For a RBIBI set it should be any of four basic styles: Regular, Italic, Bold, or Bold italic. For example, the Arial Black font has a Font Family name of Arial Black and a Subfamily name of Regular although black is not visually a regular weight.
  • If a style name doesn't fit in RBIBI category, the name records ID 16 and ID 17 should be filled.

ID 3 - Unique font identifier (fontmake: ufo.info.openTypeNameUniqueID)

Applications can use this to identify the font. Often a combination of family and style name, version number and year.

ID 4 - Full font name (fontmake: {ID 16/1} {ID 17/2})

  • It should be suitable for display in font menus.
  • Basically a combination of the family name (name ID 1) and the subfamily name (name ID 2) in a single string. In the format "Family Name Style Name".
  • The PostScript Full Name can be completed by adding style attributes in this order: Weight, Width, Slope, Optical Size (Source: Adobe tech note #5088 page)
  • Is allowed to have spaces
  • Unique in a family and human readable
  • Used by Windows and Adobe
  • Some systems match the font’s Family Name (ID 1) against the PostScript Full Name for sorting into family groups. Therefore, the PostScript Full Name should start with the Family Name. (Source: Adobe tech note #5088)

ID 5 - Version string

  • Release and version information from the font vendor.
  • The word ‘Version’ followed by the x.xxx version number.

ID 6 - PostScript name (fontmake: ufo.info.postscriptFontName)

  • Maximum length is 127 characters but 63 is safe, 29 is super safe (for legacy old softwares)
  • Not allowed to have spaces. The space can be removed and a dash is placed between family name and style name.
  • Adobe recommends the following abbreviations for style names. You can abbreviate the last word in the style name and keep the previous ones as it is. See Source Serif on the bottom of this page for an example.
Full Short
Black Blk
Bold Bd
Book Bk
Compact Ct
Compressed Cm
Condensed Cn
Demi (prefix) Dm
Display Ds
Extended Ex
Extra (prefix) X
Heavy Hv
Inclined Ic
Italic It
Kursiv Ks
Light Lt
Medium Md
Narrow Nr
Nord Nd
Oblique Obl
Poster Po
Regular Rg
Semi (prefix) Sm
Slanted Sl
Super Su
Thin Th
Ultra (prefix) Ult
Upright Up

ID 16 - Typographic Family name (fontmake: ufo.info.openTypeNamePreferredFamilyName)

  • Set this to a unified name for a font family that has multiple RBIBI font sets or has styles that doesn't fit in one RBIBI set. For example for the Arial font family for "Arial Black" and "Arial Narrow" this record is set to Arial even though their ID 1 record is different.

ID 17 - Typographic Subfamily name (fontmake: ufo.info.openTypeNamePreferredSubfamilyName)

  • This should contain the style name if ID 16 is filled.
  • Basically the record ID 4 minus anything written in ID 16.

ID 18 - Compatible full name (fontmake: ufo.info.openTypeNameCompatibleFullName)

  • Macintosh only. Only set if you want to set it differently from ID 4
  • Having this value may break cross-platform compatibility

ID 21 - WWS Family Name (fontmake: ufo.info.openTypeNameWWSFamilyName)

  • If entry for ID 17 includes a style name other than weight, width or slope; name ID 21 should be filled. Examples of name ID 21: “Minion Pro Caption” and “Minion Pro Display” in which their Name ID 16 is “Minion Pro”.

ID 22 - WWS Subfamily Name (fontmake: ufo.info.openTypeNameWWSSubfamilyName)

  • If name ID 21 is filled this should also be filled.
  • Basically the record ID 4 minus anything written in ID 21.

ID 25 - Variations PostScript Name Prefix

  • If present in a variable font, it may be used as the family prefix in the PostScript Name Generation for Variation Fonts algorithm.

Notes:

Examples

Minion Pro

An example that shows how to fill the ID 21 and 22 (source: Microsoft).

Minion Pro Regular

  • ID 1: Minion Pro
  • ID 2: Regular

Minion Pro Italic

  • ID 1: Minion Pro
  • ID 2: Italic

Minion Pro Semibold

  • ID 1: Minion Pro SmBd
  • ID 2: Regular
  • ID 16: Minion Pro
  • ID 17: Semibold

Minion Pro Semibold Italic

  • ID 1: Minion Pro SmBd
  • ID 2: Italic
  • ID 16: Minion Pro
  • ID 17: Semibold Italic

Minion Pro Caption

  • ID 1: Minion Pro Capt
  • ID 2: Regular
  • ID 16: Minion Pro
  • ID 17: Caption
  • ID 21: Minion Pro Caption
  • ID 22: Regular

Minion Pro Semibold Italic Caption

  • ID 1: Minion Pro SmBd Capt
  • ID 2: Italic
  • ID 16: Minion Pro
  • ID 17: Semibold Italic Caption
  • ID 21: Minion Pro Caption
  • ID 22: Semibold Italic

Adobe Calson Pro

source: Microsoft.

Adobe Caslon Pro Regular

  • ID 1: Adobe Caslon Pro
  • ID 2: Regular

Adobe Caslon Pro Italic

  • ID 1: Adobe Caslon Pro
  • ID 2: Italic

Adobe Caslon Pro Semibold

  • ID 1: Adobe Caslon Pro
  • ID 2: Bold
  • ID 16: Adobe Caslon Pro
  • ID 17: Semibold

Adobe Caslon Pro Semibold Italic

  • ID 1: Adobe Caslon Pro
  • ID 2: Bold Italic
  • ID 16: Adobe Caslon Pro
  • ID 17: Semibold Italic

Adobe Caslon Pro Bold

  • ID 1: Adobe Caslon Pro Bold
  • ID 2: Regular
  • ID 16: Adobe Caslon Pro
  • ID 17: Bold

Adobe Caslon Pro Bold Italic

  • ID 1: Adobe Caslon Pro Bold
  • ID 2: Italic
  • ID 16: Adobe Caslon Pro
  • ID 17: Bold Italic

Segoe UI

Source: Windows 10.

Font / Name ID 1 2 4 6 16 17
segoeuii.ttf Segoe UI Italic Segoe UI Italic SegoeUI-Italic - -
segoeuiz.ttf Segoe UI Bold Italic Segoe UI Bold Italic SegoeUI-BoldItalic - -
segoeuib.ttf Segoe UI Bold Segoe UI Bold SegoeUI-Bold - -
segoeui.ttf Segoe UI Regular Segoe UI SegoeUI - -
seguibl.ttf Segoe UI Black Regular Segoe UI Black SegoeUIBlack Segoe UI Black
seguibli.ttf Segoe UI Black Italic Segoe UI Black Italic SegoeUIBlack-Italic Segoe UI Black Italic
seguili.ttf Segoe UI Light Italic Segoe UI Light Italic SegoeUI-LightItalic Segoe UI Light Italic
segoeuil.ttf Segoe UI Light Regular Segoe UI Light SegoeUI-Light Segoe UI Light
seguisb.ttf Segoe UI Semibold Regular Segoe UI Semibold SegoeUI-Semibold Segoe UI Semibold
seguisbi.ttf Segoe UI Semibold Italic Segoe UI Semibold Italic SegoeUI-SemiboldItalic Segoe UI Semibold Italic
seguisli.ttf Segoe UI Semilight Italic Segoe UI Semilight Italic SegoeUI-SemilightItalic Segoe UI Semilight Italic
segoeuisl.ttf Segoe UI Semilight Regular Segoe UI Semilight SegoeUI-Semilight Segoe UI Semilight

Source Serif 4

source: https://github.com/adobe-fonts/source-serif/releases/tag/4.005R

Font / Name ID 1 2 4 6 16 17
SourceSerif4-Regular.ttf Source Serif 4 Regular Source Serif 4 SourceSerif4-Regular - -
SourceSerif4-Bold.ttf Source Serif 4 Bold Source Serif 4 Bold SourceSerif4-Bold - -
SourceSerif4-BoldIt.ttf Source Serif 4 Bold Italic Source Serif 4 Bold Italic SourceSerif4-BoldIt - -
SourceSerif4-It.ttf Source Serif 4 Italic Source Serif 4 Italic SourceSerif4-It - -
SourceSerif4Caption-Regular.ttf Source Serif 4 Caption Regular Source Serif 4 Caption SourceSerif4Caption-Regular - -
SourceSerif4Caption-Bold.ttf Source Serif 4 Caption Bold Source Serif 4 Caption Bold SourceSerif4Caption-Bold - -
SourceSerif4Caption-BoldIt.ttf Source Serif 4 Caption Bold Italic Source Serif 4 Caption Bold Italic SourceSerif4Caption-BoldIt - -
SourceSerif4Caption-It.ttf Source Serif 4 Caption Italic Source Serif 4 Caption Italic SourceSerif4Caption-It - -
SourceSerif4Display-Regular.ttf Source Serif 4 Display Regular Source Serif 4 Display SourceSerif4Display-Regular - -
SourceSerif4Display-Bold.ttf Source Serif 4 Display Bold Source Serif 4 Display Bold SourceSerif4Display-Bold - -
SourceSerif4Display-BoldIt.ttf Source Serif 4 Display Bold Italic Source Serif 4 Display Bold Italic SourceSerif4Display-BoldIt - -
SourceSerif4Display-It.ttf Source Serif 4 Display Italic Source Serif 4 Display Italic SourceSerif4Display-It - -
SourceSerif4SmText-Regular.ttf Source Serif 4 SmText Regular Source Serif 4 SmText SourceSerif4SmText-Regular - -
SourceSerif4SmText-Bold.ttf Source Serif 4 SmText Bold Source Serif 4 SmText Bold SourceSerif4SmText-Bold - -
SourceSerif4SmText-BoldIt.ttf Source Serif 4 SmText Bold Italic Source Serif 4 SmText Bold Italic SourceSerif4SmText-BoldIt - -
SourceSerif4SmText-It.ttf Source Serif 4 SmText Italic Source Serif 4 SmText Italic SourceSerif4SmText-It - -
SourceSerif4Subhead-Regular.ttf Source Serif 4 Subhead Regular Source Serif 4 Subhead SourceSerif4Subhead-Regular - -
SourceSerif4Subhead-Bold.ttf Source Serif 4 Subhead Bold Source Serif 4 Subhead Bold SourceSerif4Subhead-Bold - -
SourceSerif4Subhead-BoldIt.ttf Source Serif 4 Subhead Bold Italic Source Serif 4 Subhead Bold Italic SourceSerif4Subhead-BoldIt - -
SourceSerif4Subhead-It.ttf Source Serif 4 Subhead Italic Source Serif 4 Subhead Italic SourceSerif4Subhead-It - -
SourceSerif4-ExtraLight.ttf Source Serif 4 ExtraLight Regular Source Serif 4 ExtraLight SourceSerif4-ExtraLight Source Serif 4 ExtraLight
SourceSerif4-ExtraLightIt.ttf Source Serif 4 ExtraLight Italic Source Serif 4 ExtraLight Italic SourceSerif4-ExtraLightIt Source Serif 4 ExtraLight Italic
SourceSerif4-Light.ttf Source Serif 4 Light Regular Source Serif 4 Light SourceSerif4-Light Source Serif 4 Light
SourceSerif4-LightIt.ttf Source Serif 4 Light Italic Source Serif 4 Light Italic SourceSerif4-LightIt Source Serif 4 Light Italic
SourceSerif4-Semibold.ttf Source Serif 4 Semibold Regular Source Serif 4 Semibold SourceSerif4-Semibold Source Serif 4 Semibold
SourceSerif4-SemiboldIt.ttf Source Serif 4 Semibold Italic Source Serif 4 Semibold Italic SourceSerif4-SemiboldIt Source Serif 4 Semibold Italic
SourceSerif4Caption-Black.ttf Source Serif 4 Caption Black Regular Source Serif 4 Caption Black SourceSerif4Caption-Black Source Serif 4 Caption Black
SourceSerif4Caption-BlackIt.ttf Source Serif 4 Caption Black Italic Source Serif 4 Caption Black Italic SourceSerif4Caption-BlackIt Source Serif 4 Caption Black Italic
SourceSerif4Caption-ExtraLight.ttf Source Serif 4 Caption ExtraLight Regular Source Serif 4 Caption ExtraLight SourceSerif4Caption-ExtraLight Source Serif 4 Caption ExtraLight
SourceSerif4Caption-ExtraLightIt.ttf Source Serif 4 Caption ExtraLight Italic Source Serif 4 Caption ExtraLight Italic SourceSerif4Caption-ExtraLightIt Source Serif 4 Caption ExtraLight Italic
SourceSerif4Caption-Light.ttf Source Serif 4 Caption Light Regular Source Serif 4 Caption Light SourceSerif4Caption-Light Source Serif 4 Caption Light
SourceSerif4Caption-LightIt.ttf Source Serif 4 Caption Light Italic Source Serif 4 Caption Light Italic SourceSerif4Caption-LightIt Source Serif 4 Caption Light Italic
SourceSerif4Caption-Semibold.ttf Source Serif 4 Caption Semibold Regular Source Serif 4 Caption Semibold SourceSerif4Caption-Semibold Source Serif 4 Caption Semibold
SourceSerif4Caption-SemiboldIt.ttf Source Serif 4 Caption Semibold Italic Source Serif 4 Caption Semibold Italic SourceSerif4Caption-SemiboldIt Source Serif 4 Caption Semibold Italic
SourceSerif4Display-Black.ttf Source Serif 4 Display Black Regular Source Serif 4 Display Black SourceSerif4Display-Black Source Serif 4 Display Black
SourceSerif4Display-BlackIt.ttf Source Serif 4 Display Black Italic Source Serif 4 Display Black Italic SourceSerif4Display-BlackIt Source Serif 4 Display Black Italic
SourceSerif4Display-ExtraLight.ttf Source Serif 4 Display ExtraLight Regular Source Serif 4 Display ExtraLight SourceSerif4Display-ExtraLight Source Serif 4 Display ExtraLight
SourceSerif4Display-ExtraLightIt.ttf Source Serif 4 Display ExtraLight Italic Source Serif 4 Display ExtraLight Italic SourceSerif4Display-ExtraLightIt Source Serif 4 Display ExtraLight Italic
SourceSerif4Display-Light.ttf Source Serif 4 Display Light Regular Source Serif 4 Display Light SourceSerif4Display-Light Source Serif 4 Display Light
SourceSerif4Display-LightIt.ttf Source Serif 4 Display Light Italic Source Serif 4 Display Light Italic SourceSerif4Display-LightIt Source Serif 4 Display Light Italic
SourceSerif4Display-Semibold.ttf Source Serif 4 Display Semibold Regular Source Serif 4 Display Semibold SourceSerif4Display-Semibold Source Serif 4 Display Semibold
SourceSerif4Display-SemiboldIt.ttf Source Serif 4 Display Semibold Italic Source Serif 4 Display Semibold Italic SourceSerif4Display-SemiboldIt Source Serif 4 Display Semibold Italic
SourceSerif4SmText-Black.ttf Source Serif 4 SmText Black Regular Source Serif 4 SmText Black SourceSerif4SmText-Black Source Serif 4 SmText Black
SourceSerif4SmText-BlackIt.ttf Source Serif 4 SmText Black Italic Source Serif 4 SmText Black Italic SourceSerif4SmText-BlackIt Source Serif 4 SmText Black Italic
SourceSerif4SmText-ExtraLight.ttf Source Serif 4 SmText ExtraLight Regular Source Serif 4 SmText ExtraLight SourceSerif4SmText-ExtraLight Source Serif 4 SmText ExtraLight
SourceSerif4SmText-ExtraLightIt.ttf Source Serif 4 SmText ExtraLight Italic Source Serif 4 SmText ExtraLight Italic SourceSerif4SmText-ExtraLightIt Source Serif 4 SmText ExtraLight Italic
SourceSerif4SmText-Light.ttf Source Serif 4 SmText Light Regular Source Serif 4 SmText Light SourceSerif4SmText-Light Source Serif 4 SmText Light
SourceSerif4SmText-LightIt.ttf Source Serif 4 SmText Light Italic Source Serif 4 SmText Light Italic SourceSerif4SmText-LightIt Source Serif 4 SmText Light Italic
SourceSerif4SmText-Semibold.ttf Source Serif 4 SmText Semibold Regular Source Serif 4 SmText Semibold SourceSerif4SmText-Semibold Source Serif 4 SmText Semibold
SourceSerif4SmText-SemiboldIt.ttf Source Serif 4 SmText Semibold Italic Source Serif 4 SmText Semibold Italic SourceSerif4SmText-SemiboldIt Source Serif 4 SmText Semibold Italic
SourceSerif4Subhead-Black.ttf Source Serif 4 Subhead Black Regular Source Serif 4 Subhead Black SourceSerif4Subhead-Black Source Serif 4 Subhead Black
SourceSerif4Subhead-BlackIt.ttf Source Serif 4 Subhead Black Italic Source Serif 4 Subhead Black Italic SourceSerif4Subhead-BlackIt Source Serif 4 Subhead Black Italic
SourceSerif4Subhead-ExtraLight.ttf Source Serif 4 Subhead ExtraLight Regular Source Serif 4 Subhead ExtraLight SourceSerif4Subhead-ExtraLight Source Serif 4 Subhead ExtraLight
SourceSerif4Subhead-ExtraLightIt.ttf Source Serif 4 Subhead ExtraLight Italic Source Serif 4 Subhead ExtraLight Italic SourceSerif4Subhead-ExtraLightIt Source Serif 4 Subhead ExtraLight Italic
SourceSerif4Subhead-Light.ttf Source Serif 4 Subhead Light Regular Source Serif 4 Subhead Light SourceSerif4Subhead-Light Source Serif 4 Subhead Light
SourceSerif4Subhead-LightIt.ttf Source Serif 4 Subhead Light Italic Source Serif 4 Subhead Light Italic SourceSerif4Subhead-LightIt Source Serif 4 Subhead Light Italic
SourceSerif4Subhead-Semibold.ttf Source Serif 4 Subhead Semibold Regular Source Serif 4 Subhead Semibold SourceSerif4Subhead-Semibold Source Serif 4 Subhead Semibold
SourceSerif4Subhead-SemiboldIt.ttf Source Serif 4 Subhead Semibold Italic Source Serif 4 Subhead Semibold Italic SourceSerif4Subhead-SemiboldIt Source Serif 4 Subhead Semibold Italic
@typoman
Copy link
Author

typoman commented Apr 30, 2023

Python script to read the name table from fonts inside a folder and save the result to a csv file.

import os
import sys
import csv
from fontTools.ttLib import TTFont
from fontTools.ttLib.tables._n_a_m_e import NameRecord

"""
Python script to read the name table from fonts inside a folder and save the result to a `csv` file.
"""


def get_name_records(font_path, name_ids):
    records = {}
    try:
        font = TTFont(font_path)
        for name_record in font["name"].names:
            if name_record.nameID in name_ids and name_record.langID == 0x0409:
                value = name_record.toUnicode()
                if name_record.nameID not in records or len(
                    records[name_record.nameID]
                ) < len(value):
                    records[name_record.nameID] = value
    except:
        pass
    return records


def main(folder_path, output_file):
    name_ids = [1, 2, 3, 4, 6, 16, 17, 18, 21, 22]

    with open(output_file, "w", newline="", encoding="utf-8") as csvfile:
        csvwriter = csv.writer(
            csvfile, delimiter="\t", quotechar='"', quoting=csv.QUOTE_MINIMAL
        )
        header = ["Font"] + name_ids
        csvwriter.writerow(header)

        for filename in os.listdir(folder_path):
            if filename.endswith(".ttf") or filename.endswith(".otf"):
                font_path = os.path.join(folder_path, filename)
                records = get_name_records(font_path, name_ids)
                row = [filename]
                for name_id in name_ids:
                    row.append(records.get(name_id, "-"))
                csvwriter.writerow(row)


if __name__ == "__main__":
    if len(sys.argv) < 3:
        print("Usage: python script.py <folder_path> <output_file>")
    else:
        main(sys.argv[1], sys.argv[2])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment