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