diff --git a/Lib/fontTools/varLib/instancer/__init__.py b/Lib/fontTools/varLib/instancer/__init__.py index 4f00ed7be..b8f532808 100644 --- a/Lib/fontTools/varLib/instancer/__init__.py +++ b/Lib/fontTools/varLib/instancer/__init__.py @@ -1315,7 +1315,7 @@ def parseArgs(args): "locargs", metavar="AXIS=LOC", nargs="*", - help="List of space separated locations. A location consist in " + help="List of space separated locations. A location consists of " "the tag of a variation axis, followed by '=' and one of number, " "number:number or the literal string 'drop'. " "E.g.: wdth=100 or wght=75.0:125.0 or wght=drop", diff --git a/Lib/fontTools/varLib/mutator.py b/Lib/fontTools/varLib/mutator.py index ad76420a1..39755ad02 100644 --- a/Lib/fontTools/varLib/mutator.py +++ b/Lib/fontTools/varLib/mutator.py @@ -345,14 +345,8 @@ def instantiateVariableFont(varfont, location, inplace=False, overlap=True): # Change maxp attributes as IDEF is added if 'maxp' in varfont: maxp = varfont['maxp'] - if hasattr(maxp, "maxInstructionDefs"): - maxp.maxInstructionDefs += 1 - else: - setattr(maxp, "maxInstructionDefs", 1) - if hasattr(maxp, "maxStackElements"): - maxp.maxStackElements = max(len(loc), maxp.maxStackElements) - else: - setattr(maxp, "maxInstructionDefs", len(loc)) + setattr(maxp, "maxInstructionDefs", 1 + getattr(maxp, "maxInstructionDefs", 0)) + setattr(maxp, "maxStackElements", max(len(loc), getattr(maxp, "maxStackElements", 0))) if 'name' in varfont: log.info("Pruning name table")