Lines Matching full:args
71 for op,args in commands:
72 program.extend(args)
88 def rmoveto(args): argument
89 if len(args) != 2: raise ValueError(args)
90 yield ('rmoveto', args)
92 def hmoveto(args): argument
93 if len(args) != 1: raise ValueError(args)
94 yield ('rmoveto', [args[0], 0])
96 def vmoveto(args): argument
97 if len(args) != 1: raise ValueError(args)
98 yield ('rmoveto', [0, args[0]])
101 def rlineto(args): argument
102 if not args: raise ValueError(args)
103 for args in _everyN(args, 2):
104 yield ('rlineto', args)
106 def hlineto(args): argument
107 if not args: raise ValueError(args)
108 it = iter(args)
116 def vlineto(args): argument
117 if not args: raise ValueError(args)
118 it = iter(args)
126 def rrcurveto(args): argument
127 if not args: raise ValueError(args)
128 for args in _everyN(args, 6):
129 yield ('rrcurveto', args)
131 def hhcurveto(args): argument
132 if len(args) < 4 or len(args) % 4 > 1: raise ValueError(args)
133 if len(args) % 2 == 1:
134 yield ('rrcurveto', [args[1], args[0], args[2], args[3], args[4], 0])
135 args = args[5:]
136 for args in _everyN(args, 4):
137 yield ('rrcurveto', [args[0], 0, args[1], args[2], args[3], 0])
139 def vvcurveto(args): argument
140 if len(args) < 4 or len(args) % 4 > 1: raise ValueError(args)
141 if len(args) % 2 == 1:
142 yield ('rrcurveto', [args[0], args[1], args[2], args[3], 0, args[4]])
143 args = args[5:]
144 for args in _everyN(args, 4):
145 yield ('rrcurveto', [0, args[0], args[1], args[2], 0, args[3]])
147 def hvcurveto(args): argument
148 if len(args) < 4 or len(args) % 8 not in {0,1,4,5}: raise ValueError(args)
150 if len(args) % 2 == 1:
151 lastStraight = len(args) % 8 == 5
152 args, last_args = args[:-5], args[-5:]
153 it = _everyN(args, 4)
156 args = next(it)
157 yield ('rrcurveto', [args[0], 0, args[1], args[2], 0, args[3]])
158 args = next(it)
159 yield ('rrcurveto', [0, args[0], args[1], args[2], args[3], 0])
163 args = last_args
165 yield ('rrcurveto', [args[0], 0, args[1], args[2], args[4], args[3]])
167 yield ('rrcurveto', [0, args[0], args[1], args[2], args[3], args[4]])
169 def vhcurveto(args): argument
170 if len(args) < 4 or len(args) % 8 not in {0,1,4,5}: raise ValueError(args)
172 if len(args) % 2 == 1:
173 lastStraight = len(args) % 8 == 5
174 args, last_args = args[:-5], args[-5:]
175 it = _everyN(args, 4)
178 args = next(it)
179 yield ('rrcurveto', [0, args[0], args[1], args[2], args[3], 0])
180 args = next(it)
181 yield ('rrcurveto', [args[0], 0, args[1], args[2], 0, args[3]])
185 args = last_args
187 yield ('rrcurveto', [0, args[0], args[1], args[2], args[3], args[4]])
189 yield ('rrcurveto', [args[0], 0, args[1], args[2], args[4], args[3]])
192 def rcurveline(args): argument
193 if len(args) < 8 or len(args) % 6 != 2: raise ValueError(args)
194 args, last_args = args[:-2], args[-2:]
195 for args in _everyN(args, 6):
196 yield ('rrcurveto', args)
199 def rlinecurve(args): argument
200 if len(args) < 8 or len(args) % 2 != 0: raise ValueError(args)
201 args, last_args = args[:-6], args[-6:]
202 for args in _everyN(args, 2):
203 yield ('rlineto', args)
210 for op,args in commands:
213 result.append((op,args))
216 for command in func(args):
222 result.append(('', args))
367 op,args = commands[i]
370 c, args = _categorizeVector(args)
371 commands[i] = c+op[1:], args
375 c1, args1 = _categorizeVector(args[:2])
376 c2, args2 = _categorizeVector(args[-2:])
377 commands[i] = c1+c2+'curveto', args1+args[2:4]+args2
404 op, args = commands[i]
408 assert len(args) == 4
409 c, args = _categorizeVector(args[1:3])
411 commands[i] = op, args
422 (not isinstance(args[0], list))):
424 assert len(args) == 1 and len(other_args) == 1
425 commands[i-1] = (op, [other_args[0]+args[0]])
432 op,args = commands[i]
436 assert len(args) == 1
437 args = [0, args[0]] if op[0] == 'v' else [args[0], 0]
438 commands[i] = ('rlineto', args)
441 if op[2:] == 'curveto' and len(args) == 5 and prv == nxt == 'rrcurveto':
451 # Insert, while maintaining the type of args (can be tuple or list).
452 args = args[:pos] + type(args)((0,)) + args[pos:]
453 commands[i] = ('rrcurveto', args)
508 op,args = commands[i]
511 commands[i] = 'h'+op[1:], args
517 assert len(args) % 2 == 1
524 if len(args) % 2:
526 if (op0 == 'h') ^ (len(args) % 8 == 1):
527 # Swap last two args order
528 args = args[:-2]+args[-1:]+args[-2:-1]
531 # Swap first two args order
532 args = args[1:2]+args[:1]+args[2:]
534 commands[i] = op0+op1+'curveto', args