Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class verticalText1(Flowable): # Rotates a text in a table cell.
- def __init__(self, text, pos_x=26, pos_y=3):
- Flowable.__init__(self)
- self.pos_x = pos_x
- self.pos_y = pos_y
- self.text = text
- def draw(self):
- canvas = self.canv
- canvas.rotate(90)
- fs = canvas._fontsize
- # Измества канваса малко надясно
- canvas.translate(1, -fs/1.2) # canvas._leading?
- #canvas.drawString(0, 0, self.text)
- draw_wrapped_line(canvas, self.text, 16, self.pos_x, self.pos_y, 7)
- def wrap(self, aW, aH):
- canv = self.canv
- fn, fs = canv._fontname, canv._fontsize
- return canv._leading, 1 + canv.stringWidth(self.text, fn, fs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement