[reportlab-users] outlined text?
robin at reportlab.com
Mon Nov 12 05:30:33 EST 2007
Dinu Gherman wrote:
> Jason Craig:
>> Is it possible to (somewhat easily) draw outlined text either with the
>> raw graphics functions or platypus? I was hoping that simply setting
>> stroke color to black and fill color to white, then drawString would
>> do the trick but it doesn't :(
> I'm not aware of such a functionality, but the easiest way to get it,
> is to use outlined fonts, e.g. in TrueType, if you just need a simple
> type of outline and not fancy stuff like double outlines with gradients
> between the lines, etc.
We have drawn outlined fonts in the past using the text rendering mode method in
a TextObject. The following script shows that the render mode seems to persist
outside the text object that creates it.
from reportlab.pdfgen.canvas import Canvas
c = Canvas('hello.pdf')
This technique can probably be made easier, but I can't figure out from the PDF
spec if it is really intended to work this way so be careful.
More information about the reportlab-users