[merge] Ignore LangSys if None

Fixes https://github.com/fonttools/fonttools/issues/739
for now, though proper fix is more complicated.

This was hit now because the subsetter was changed a while back
to retain script systems even if empty...  I don't like that.
This commit is contained in:
Behdad Esfahbod 2016-11-08 14:06:50 -08:00
parent 4868a631b9
commit a11bc5655d

View File

@ -513,6 +513,7 @@ def merge(self, m, tables):
for script in table.table.ScriptList.ScriptRecord: for script in table.table.ScriptList.ScriptRecord:
if script.ScriptTag == 'DFLT': continue # XXX if script.ScriptTag == 'DFLT': continue # XXX
for langsys in [script.Script.DefaultLangSys] + [l.LangSys for l in script.Script.LangSysRecord]: for langsys in [script.Script.DefaultLangSys] + [l.LangSys for l in script.Script.LangSysRecord]:
if langsys is None: continue # XXX Create!
feature = [featureMap[v] for v in langsys.FeatureIndex if featureMap[v].FeatureTag == 'locl'] feature = [featureMap[v] for v in langsys.FeatureIndex if featureMap[v].FeatureTag == 'locl']
assert len(feature) <= 1 assert len(feature) <= 1
if feature: if feature: