[reportlab-users] outline chars

Tim Roberts timr at probo.com
Thu Oct 6 14:30:19 EDT 2011


Tim Roberts wrote:

> The same concept applies to text, but because outlining is not usually

> what you want, the default is only to use "fill" with text. You can

> override that when you draw the string. If you are using a textobject,

> you use setTextRenderMode. 0 means fill only, 1 means stroke only, 2

> means fill then stroke.


Whoops, I left out an important sentence there. "If you are not using
textobjects, but instead are directly calling drawString or
drawRightString or drawCenteredString, you pass this as the "mode"
parameter:


> So:

> cv.setFillColor( (0,1,0) ) # fill with green

> cv.setStrokeColor( (0,0,1) ) # stroke with blue

> cv.setFont( 'Bookman-Bold', 36 )

> cv.drawString( 100, 100, 'Outline', mode=2 )


--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list