From 24346aaa88fbd78299b86caa3411e86ecc3ec001 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 2 Sep 2016 17:33:25 -0700 Subject: [PATCH] [varLib] Store name entries with Windows English encoding instead of MacRoman --- Lib/fontTools/varLib/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/varLib/__init__.py b/Lib/fontTools/varLib/__init__.py index 4cb661a40..5b047302d 100644 --- a/Lib/fontTools/varLib/__init__.py +++ b/Lib/fontTools/varLib/__init__.py @@ -37,11 +37,13 @@ import os.path # TODO: Move to name table proper; also, is mac_roman ok for ASCII names? def _AddName(font, name): """(font, "Bold") --> NameRecord""" + name = tounicode(name) + nameTable = font.get("name") namerec = NameRecord() namerec.nameID = 1 + max([n.nameID for n in nameTable.names] + [256]) namerec.string = name - namerec.platformID, namerec.platEncID, namerec.langID = (1, 0, 0) + namerec.platformID, namerec.platEncID, namerec.langID = (3, 1, 0x409) nameTable.names.append(namerec) return namerec