[varLib.mutator] Simplify maxp handling
This commit is contained in:
parent
23e5d4eb0b
commit
a93ced044f
@ -345,14 +345,8 @@ def instantiateVariableFont(varfont, location, inplace=False, overlap=True):
|
|||||||
# Change maxp attributes as IDEF is added
|
# Change maxp attributes as IDEF is added
|
||||||
if 'maxp' in varfont:
|
if 'maxp' in varfont:
|
||||||
maxp = varfont['maxp']
|
maxp = varfont['maxp']
|
||||||
if hasattr(maxp, "maxInstructionDefs"):
|
setattr(maxp, "maxInstructionDefs", 1 + getattr(maxp, "maxInstructionDefs", 0))
|
||||||
maxp.maxInstructionDefs += 1
|
setattr(maxp, "maxStackElements", max(len(loc), getattr(maxp, "maxStackElements", 0)))
|
||||||
else:
|
|
||||||
setattr(maxp, "maxInstructionDefs", 1)
|
|
||||||
if hasattr(maxp, "maxStackElements"):
|
|
||||||
maxp.maxStackElements = max(len(loc), maxp.maxStackElements)
|
|
||||||
else:
|
|
||||||
setattr(maxp, "maxStackElements", len(loc))
|
|
||||||
|
|
||||||
if 'name' in varfont:
|
if 'name' in varfont:
|
||||||
log.info("Pruning name table")
|
log.info("Pruning name table")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user