[reportlab-users] Several questions about text output

Andy Robinson andy at reportlab.com
Sun Jul 13 17:29:35 EDT 2008


2008/7/13 Grzegorz Adam Hankiewicz <gradha at titanium.sabren.com>:

> 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


It's called stringWidth(..) and it's available as a canvas method, or
a function in reportlab.pdfbase.pfdmetrics.stringWidth

- Andy


More information about the reportlab-users mailing list