add custom __init__ in favor of setting .data externally
This commit is contained in:
parent
a0af5727e1
commit
a32a92e6d7
@ -39,6 +39,10 @@ GVAR_HEADER_FORMAT = """
|
||||
GVAR_HEADER_SIZE = sstruct.calcsize(GVAR_HEADER_FORMAT)
|
||||
|
||||
class _LazyDict(UserDict):
|
||||
def __init__(self, data):
|
||||
super().__init__()
|
||||
self.data = data
|
||||
|
||||
def __getitem__(self, k):
|
||||
v = self.data[k]
|
||||
if callable(v):
|
||||
@ -120,8 +124,7 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
|
||||
for gid in range(self.glyphCount):
|
||||
glyphName = glyphs[gid]
|
||||
variations[glyphName] = partial(decompileVarGlyph, glyphName, gid)
|
||||
self.variations = _LazyDict()
|
||||
self.variations.data = variations
|
||||
self.variations = _LazyDict(variations)
|
||||
|
||||
@staticmethod
|
||||
def decompileOffsets_(data, tableFormat, glyphCount):
|
||||
|
Loading…
x
Reference in New Issue
Block a user