Merge pull request #2984 from PoomSmart/patch-1

Ensure sbix's Glyph.referenceGlyphName is set
This commit is contained in:
Cosimo Lupo 2023-02-06 16:34:15 +00:00 committed by GitHub
commit 955a2a2437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: