Ensure sbix's Glyph.referenceGlyphName is set

This commit is contained in:
Thatchapon Unprasert 2023-02-06 21:31:13 +07:00 committed by GitHub
parent 68ab25b88a
commit c1509a30c4
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: