[instancer/CFF2] Micro-optimize commands
This commit is contained in:
parent
1011d7e996
commit
b3dc48a967
@ -751,7 +751,10 @@ def instantiateCFF2(
|
||||
|
||||
# Empty out the VarStore
|
||||
for i, varData in enumerate(varStore.VarData):
|
||||
assert varDataCursor[i] == varData.ItemCount, (varDataCursor[i], varData.ItemCount)
|
||||
assert varDataCursor[i] == varData.ItemCount, (
|
||||
varDataCursor[i],
|
||||
varData.ItemCount,
|
||||
)
|
||||
varData.Item = []
|
||||
varData.ItemCount = 0
|
||||
|
||||
@ -779,6 +782,11 @@ def instantiateCFF2(
|
||||
if command[0] == "vsindex":
|
||||
command[1][0] = vsindexMapping[command[1][0]]
|
||||
|
||||
# Remove initial vsindex commands that are implied
|
||||
for commands in allCommands:
|
||||
if commands and commands[0] == ("vsindex", [0]):
|
||||
commands.pop(0)
|
||||
|
||||
# Ship the charstrings!
|
||||
for cs, commands in zip(charStrings, allCommands):
|
||||
cs.program = commandsToProgram(commands)
|
||||
|
@ -183,7 +183,6 @@
|
||||
<CharString name=".notdef">
|
||||
</CharString>
|
||||
<CharString name="A">
|
||||
0 vsindex
|
||||
9 30 1 blend
|
||||
hmoveto
|
||||
122 31 1 blend
|
||||
|
Loading…
x
Reference in New Issue
Block a user