From c1509a30c48a90b8abfca9ffbbd28c6c1af058e1 Mon Sep 17 00:00:00 2001 From: Thatchapon Unprasert Date: Mon, 6 Feb 2023 21:31:13 +0700 Subject: [PATCH] Ensure sbix's Glyph.referenceGlyphName is set --- Lib/fontTools/ttLib/tables/sbixGlyph.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/sbixGlyph.py b/Lib/fontTools/ttLib/tables/sbixGlyph.py index e563ea9a3..d1609cc68 100644 --- a/Lib/fontTools/ttLib/tables/sbixGlyph.py +++ b/Lib/fontTools/ttLib/tables/sbixGlyph.py @@ -133,9 +133,9 @@ class Glyph(object): # glyph is a "dupe", i.e. a reference to another glyph's image data. # in this case imageData contains the glyph id of the reference glyph # get glyph id from glyphname - self.imageData = struct.pack( - ">H", ttFont.getGlyphID(safeEval("'''" + attrs["glyphname"] + "'''")) - ) + glyphname = safeEval("'''" + attrs["glyphname"] + "'''") + self.imageData = struct.pack(">H", ttFont.getGlyphID(glyphname)) + self.referenceGlyphName = glyphname elif name == "hexdata": self.imageData = readHex(content) else: