[reportlab-users] Several questions about text output

Grzegorz Adam Hankiewicz gradha at titanium.sabren.com
Sun Jul 13 16:48:10 EDT 2008


Hello.

I'm creating a custom form like page and don't want to use platypus.

I'm willing to output a string in the form "header: text" where the
header part is bold. I thought I would output the header with a bold
font, then the text with the normal face. However, how do I get the
length of the header part? I was looking for some getStringSize(font,
text) which would return the width and height of the expected text,
but haven't. Also canvas.drawString doesn't return such information.

On the font issue, how can I clip the text to a region? Let's say that
I have a text too long to fit and don't want it to go out of the page.
Is this done with the paths?


More information about the reportlab-users mailing list