[Image-SIG] write text on a picture
Mon, 7 Apr 2003 18:49:32 -0400
HI! Everyone: I am using pytohn image library to draw a picture with some
text on it. I can draw things like circles, etc, which means my python
library works well. But I can't write text on it.
>>>write.text((0, 0, 100,100), 'red') Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/site-packages/PIL/ImageDraw.py", line
155, in text
font = self.getfont()
File "/usr/local/lib/python2.2/site-packages/PIL/ImageDraw.py", line 61,
self.font = ImageFont.load_path("BDF/courR14.pil")
File "/usr/local/lib/python2.2/site-packages/PIL/ImageFont.py", line
161, in load_path
raise IOError, "cannot find font file" IOError: cannot find font file
I can't find the directory BDF.
I am a beginner in python library. So I don't know whether I used wrong
command or my library is incomplete.
And in the PIL handbook the chapter on how to write is a little confusing.
So would you like to tell me how to solve this problem. If you know some
cookbook about it, please let me know.
Thanks a lot!