[varLib] Implement mapping tail optimization
This commit is contained in:
parent
687c2c1812
commit
76ce34b06c
@ -497,6 +497,8 @@ def _add_HVAR(font, model, master_ttfs, axes):
|
||||
newItems = sorted(uniq)
|
||||
mapper = {v:i for i,v in enumerate(newItems)}
|
||||
mapping = [mapper[item] for item in items]
|
||||
while len(mapping) > 1 and mapping[-1] == mapping[-2]:
|
||||
del mapping[-1]
|
||||
advanceMapping = builder.buildVarIdxMap(mapping)
|
||||
items = newItems
|
||||
del mapper, mapping, newItems
|
||||
|
Loading…
x
Reference in New Issue
Block a user