varLib: initialize all fields to None in new empty GDEF

code elsewhere assumes that all optional fields in OT tables are initialized
to None (that is the case when decompiling from a file).
This patch makes sure that the new GDEF table build by varLib when creating
a new VF is properly initialised.
Ideally we wouldn't have to do that manually, but the constructor would
take care of that. But otData-generated classes are special...
This commit is contained in:
Cosimo Lupo 2019-04-18 17:29:56 +01:00
parent 9aa5407f31
commit 7209862e89
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642

View File

@ -597,9 +597,15 @@ def _merge_OTL(font, model, master_fonts, axisTags):
GDEF = font['GDEF'].table
assert GDEF.Version <= 0x00010002
except KeyError:
font['GDEF']= newTable('GDEF')
font['GDEF'] = newTable('GDEF')
GDEFTable = font["GDEF"] = newTable('GDEF')
GDEF = GDEFTable.table = ot.GDEF()
GDEF.GlyphClassDef = None
GDEF.AttachList = None
GDEF.LigCaretList = None
GDEF.MarkAttachClassDef = None
GDEF.MarkGlyphSetsDef = None
GDEF.Version = 0x00010003
GDEF.VarStore = store