[cffLib.specializer] Try keeping type of args

41445b8449 (commitcomment-22260340)
This commit is contained in:
Behdad Esfahbod 2018-02-18 11:48:22 -08:00
parent e7494cba5b
commit a07a6f85f7

View File

@ -436,7 +436,6 @@ def specializeCommands(commands,
if op[2:] == 'curveto' and len(args) == 5 and prv == nxt == 'rrcurveto':
assert (op[0] == 'r') ^ (op[1] == 'r')
args = list(args)
if op[0] == 'v':
pos = 0
elif op[0] != 'r':
@ -445,7 +444,8 @@ def specializeCommands(commands,
pos = 4
else:
pos = 5
args.insert(pos, 0)
# Insert, while maintaining the type of args (can be tuple or list).
args = args[:pos] + type(args)((0,)) + args[pos:]
commands[i] = ('rrcurveto', args)
continue