Ejemplo n.º 1
0
 def updatepath(self, path, trafo, context):
     dy1 = context.t1stack.pop(0)
     dx2 = context.t1stack.pop(0)
     dy2 = context.t1stack.pop(0)
     dx3 = context.t1stack.pop(0)
     path.append(curveto_pt(*(trafo.apply_pt(context.x,             context.y + dy1) +
                              trafo.apply_pt(context.x + dx2,       context.y + dy1 + dy2) +
                              trafo.apply_pt(context.x + dx2 + dx3, context.y + dy1 + dy2))))
     context.x += dx2+dx3
     context.y += dy1+dy2
Ejemplo n.º 2
0
 def updatepath(self, path, trafo, context):
     dy1 = context.t1stack.pop(0)
     dx2 = context.t1stack.pop(0)
     dy2 = context.t1stack.pop(0)
     dx3 = context.t1stack.pop(0)
     path.append(curveto_pt(*(trafo.apply_pt(context.x,             context.y + dy1) +
                              trafo.apply_pt(context.x + dx2,       context.y + dy1 + dy2) +
                              trafo.apply_pt(context.x + dx2 + dx3, context.y + dy1 + dy2))))
     context.x += dx2+dx3
     context.y += dy1+dy2
Ejemplo n.º 3
0
 def updatepath(self, path, trafo, context):
     dx1 = context.t1stack.pop(0)
     dx2 = context.t1stack.pop(0)
     dy2 = context.t1stack.pop(0)
     dy3 = context.t1stack.pop(0)
     path.append(curveto_pt(*(trafo.apply_pt(context.x + dx1,       context.y) +
                              trafo.apply_pt(context.x + dx1 + dx2, context.y + dy2) +
                              trafo.apply_pt(context.x + dx1 + dx2, context.y + dy2 + dy3))))
     context.x += dx1+dx2
     context.y += dy2+dy3
Ejemplo n.º 4
0
 def updatepath(self, path, trafo, context):
     dx1 = context.t1stack.pop(0)
     dx2 = context.t1stack.pop(0)
     dy2 = context.t1stack.pop(0)
     dy3 = context.t1stack.pop(0)
     path.append(curveto_pt(*(trafo.apply_pt(context.x + dx1,       context.y) +
                              trafo.apply_pt(context.x + dx1 + dx2, context.y + dy2) +
                              trafo.apply_pt(context.x + dx1 + dx2, context.y + dy2 + dy3))))
     context.x += dx1+dx2
     context.y += dy2+dy3
Ejemplo n.º 5
0
 def updatepath(self, path, trafo, context):
     sbx = context.t1stack.pop(0)
     wx = context.t1stack.pop(0)
     path.append(moveto_pt(*trafo.apply_pt(sbx, 0)))
     context.x = sbx
     context.y = 0
     context.wx = wx
     context.wy = 0
Ejemplo n.º 6
0
 def updatepath(self, path, trafo, context):
     sbx = context.t1stack.pop(0)
     wx = context.t1stack.pop(0)
     path.append(moveto_pt(*trafo.apply_pt(sbx, 0)))
     context.x = sbx
     context.y = 0
     context.wx = wx
     context.wy = 0
Ejemplo n.º 7
0
 def updatepath(self, path, trafo, context):
     othersubrnumber = context.t1stack.pop()
     n = context.t1stack.pop()
     for i in range(n):
         context.psstack.append(context.t1stack.pop(0))
     if othersubrnumber == 0:
         flex_size, x, y = context.psstack[-3:]
         if context.flex:
             x1, y1, x2, y2, x3, y3 = context.psstack[2:8]
             x1, y1 = trafo.apply_pt(x1, y1)
             x2, y2 = trafo.apply_pt(x2, y2)
             x3, y3 = trafo.apply_pt(x3, y3)
             path.append(curveto_pt(x1, y1, x2, y2, x3, y3))
             x1, y1, x2, y2, x3, y3 = context.psstack[8:14]
             x1, y1 = trafo.apply_pt(x1, y1)
             x2, y2 = trafo.apply_pt(x2, y2)
             x3, y3 = trafo.apply_pt(x3, y3)
             path.append(curveto_pt(x1, y1, x2, y2, x3, y3))
         else:
             path.append(lineto_pt(*trafo.apply_pt(x, y)))
         context.psstack = [y, x]
     elif othersubrnumber == 1:
         pass
     elif othersubrnumber == 2:
         path.pathitems.pop()
         context.psstack.append(context.x)
         context.psstack.append(context.y)
Ejemplo n.º 8
0
 def updatepath(self, path, trafo, context):
     othersubrnumber = context.t1stack.pop()
     n = context.t1stack.pop()
     for i in range(n):
         context.psstack.append(context.t1stack.pop(0))
     if othersubrnumber == 0:
         flex_size, x, y = context.psstack[-3:]
         if context.flex:
             x1, y1, x2, y2, x3, y3 = context.psstack[2:8]
             x1, y1 = trafo.apply_pt(x1, y1)
             x2, y2 = trafo.apply_pt(x2, y2)
             x3, y3 = trafo.apply_pt(x3, y3)
             path.append(curveto_pt(x1, y1, x2, y2, x3, y3))
             x1, y1, x2, y2, x3, y3 = context.psstack[8:14]
             x1, y1 = trafo.apply_pt(x1, y1)
             x2, y2 = trafo.apply_pt(x2, y2)
             x3, y3 = trafo.apply_pt(x3, y3)
             path.append(curveto_pt(x1, y1, x2, y2, x3, y3))
         else:
             path.append(lineto_pt(*trafo.apply_pt(x, y)))
         context.psstack = [y, x]
     elif othersubrnumber == 1:
         pass
     elif othersubrnumber == 2:
         path.pathitems.pop()
         context.psstack.append(context.x)
         context.psstack.append(context.y)
Ejemplo n.º 9
0
 def updatepath(self, path, trafo, context):
     dy = context.t1stack.pop(0)
     path.append(moveto_pt(*trafo.apply_pt(context.x, context.y + dy)))
     context.y += dy
Ejemplo n.º 10
0
 def updatepath(self, path, trafo, context):
     dx = context.t1stack.pop(0)
     dy = context.t1stack.pop(0)
     path.append(lineto_pt(*trafo.apply_pt(context.x + dx, context.y + dy)))
     context.x += dx
     context.y += dy
Ejemplo n.º 11
0
 def updatepath(self, path, trafo, context):
     path.append(closepath())
     # The closepath in T1 is different from PostScripts in that it does
     # *not* modify the current position; hence we need to add an additional
     # moveto here ...
     path.append(moveto_pt(*trafo.apply_pt(context.x, context.y)))
Ejemplo n.º 12
0
 def updatepath(self, path, trafo, context):
     dy = context.t1stack.pop(0)
     path.append(moveto_pt(*trafo.apply_pt(context.x, context.y + dy)))
     context.y += dy
Ejemplo n.º 13
0
 def updatepath(self, path, trafo, context):
     dx = context.t1stack.pop(0)
     dy = context.t1stack.pop(0)
     path.append(lineto_pt(*trafo.apply_pt(context.x + dx, context.y + dy)))
     context.x += dx
     context.y += dy
Ejemplo n.º 14
0
 def updatepath(self, path, trafo, context):
     path.append(closepath())
     # The closepath in T1 is different from PostScripts in that it does
     # *not* modify the current position; hence we need to add an additional
     # moveto here ...
     path.append(moveto_pt(*trafo.apply_pt(context.x, context.y)))
Ejemplo n.º 15
0
 def updatepath(self, path, trafo, context):
     x = context.t1stack.pop(0)
     y = context.t1stack.pop(0)
     path.append(moveto_pt(*trafo.apply_pt(x, y)))
     context.x = x
     context.y = y