diff --git a/Lib/fontTools/ttLib/tables/_n_a_m_e.py b/Lib/fontTools/ttLib/tables/_n_a_m_e.py index 6c5c619c8..12270d899 100644 --- a/Lib/fontTools/ttLib/tables/_n_a_m_e.py +++ b/Lib/fontTools/ttLib/tables/_n_a_m_e.py @@ -177,7 +177,10 @@ class table__n_a_m_e(DefaultTable.DefaultTable): ltag = ttFont.tables.get("ltag") if ltag is None: ltag = ttFont["ltag"] = newTable("ltag") - self.names.append(makeName(name, nameID, 2, 4, ltag.addTag(lang))) + # 0 = Unicode; 4 = “Unicode 2.0 or later semantics (non-BMP characters allowed)” + # “The preferred platform-specific code for Unicode would be 3 or 4.” + # https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html + self.names.append(makeName(name, nameID, 0, 4, ltag.addTag(lang))) # Add a Windows name. windowsLang = _WINDOWS_LANGUAGE_CODES.get(lang.lower()) if windowsLang is not None: diff --git a/Tests/ttLib/tables/_n_a_m_e_test.py b/Tests/ttLib/tables/_n_a_m_e_test.py index f5c123556..d434f20a7 100644 --- a/Tests/ttLib/tables/_n_a_m_e_test.py +++ b/Tests/ttLib/tables/_n_a_m_e_test.py @@ -83,14 +83,14 @@ class NameTableTest(unittest.TestCase): for n in nameTable.names] names.sort() self.assertEqual(names, [ + (256, 0, 4, 0, "Breite"), + (256, 0, 4, 1, "Bräiti"), (256, 1, 0, 0, "Width"), - (256, 2, 4, 0, "Breite"), - (256, 2, 4, 1, "Bräiti"), (256, 3, 1, 0x0409, "Width"), (256, 3, 1, 0x0484, "Bräiti"), (256, 3, 1, 0x0807, "Breite"), + (257, 0, 4, 1, "X-Hööchi"), (257, 1, 0, 0, "X-Height"), - (257, 2, 4, 1, "X-Hööchi"), (257, 3, 1, 0x0409, "X-Height"), (257, 3, 1, 0x0484, "X-Hööchi"), ])