[Image-SIG] Using ImageDraw text

Cotten cotten@mediarewards.com
Fri, 28 Jul 2000 08:43:00 -0700


Dear Pythoneers:

I am trying to use the PIL to create dynamic pie charts.  Got the pieslices
displayed just fine, but am having a bear of a time getting the text labels
to display.  I have the most recent docs from pythonware, but they don't
describe how the text methods are supposed to be used.  Looking to the
source hasn't gotten me much further.

How should I solve my immediate problem?  And where can I find more complete
documentation for the PIL?  (Still trying to get the link on O'Reilly's
Python DevCenter to work...)

Thanks in advance for your generous help!

Cotten Blackwell

-----------


The offending code:
-----------
thisFont = ImageFont.ImageFont()
draw.text(xy = (lineEndX-40, lineEndY-20, lineEndX+40, lineEndY),
text=thisSlice, fill=sliceFill, font=thisFont)


The error:
-----------
Traceback (innermost last):
  File "<input>", line 1, in ?
  File "Macintosh HD:garden:pyscripts:im.py", line 102, in pieChart
    draw.text(xy = (lineEndX-40, lineEndY-20, lineEndX+40, lineEndY),
text=thisSlice, fill=sliceFill, font=thisFont)
  File "Macintosh HD:Applications:Development:Python
1.5.2c1:Extensions:Imaging:PIL:ImageDraw.py", line 151, in text
    self.im.draw_bitmap(xy, font.getmask(text), ink)
AttributeError: draw_bitmap