A couple of options:
(a) You could use textOut instead of textLine, which leaves getX()
where it is; then when you have queried it, output a new line (e.g.
with canvas.textLine('')).
(b) write a helper function which takes a canvas, a font name, size
and list of lines. Explicitly call stringWidth on each line of text
to work out the longest, then draw all the text as you do above, and
return the max width at the end.
Or for maximum points, you could add some tracking code to textobject
so it knew its width at all times and submit a patch - we'd like that!
- Andy
> _______________________________________________
> reportlab-users mailing list
>
reportl...@lists2.reportlab.com
>
http://two.pairlist.net/mailman/listinfo/reportlab-users
>
--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel
+44-20-8405-6420
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users