[Fwd: [IMAGE-SIG] broken ImageFont?]

Daniel Michelson Daniel.Michelson@smhi.se
Tue, 19 Aug 1997 08:40:41 +0200


Hej,

Nice on-line PIL documentation! =


Does anyone (/F) have any suggestions on how to proceed with the issue
of stamping strings into an image? To be honest, I have no idea what the
error below means other than that I can't stamp my string...

On a related matter, /F mentions that new PIL fonts can be created using
fstobdf first and bdf2pil.py second. My man pages are very terse on the
subject of fstobdf: the -server option "specifies the server from which
the font should be read". But what's the correct syntax for the -s
option (my hostname doesn't work)? Could someone please give me an
example to copy?

> import Image, ImageDraw, ImageFont
> =

> test =3D "This is a test."
> =

> this =3D Image.new("1", (512, 512))
> font =3D ImageFont.load("courBO18.pil")
> draw =3D ImageDraw.ImageDraw(this)
> draw.setfont(font)
> draw.setink(0)
> draw.text((0,0), test)
> Traceback (innermost last):
>   File "text.py", line 10, in ?
>     draw.text((0,0), teststring)
>   File "...Imaging/Lib/ImageDraw.py", line 68, in text
>     m =3D self.font.getmask(text)
>   File "...Imaging/Lib/ImageFont.py", line 84, in getmask
>     im.im.paste(self.image.im.crop(tuple(m[6:10])),
> SystemError: NULL result without error in call_object
> =

> What next?

best, -d

+------------------+--------------------------------------------------+
|                  | Daniel B. Michelson                              |
| /\ |\  /| |  | | | Swedish Meteorological and Hydrological Institute|
| \  | \/ | |__| | | S-601 76 Norrk=F6ping, Sweden                      |=

|  \ |    | |  | | | Telephone: +46 11 - 15 84 94                     |
| \/ |    | |  | | | Telefax:   +46 11 - 17 02 07                     |
|                  | Internet:  Daniel.Michelson@smhi.se              |
+------------------+--------------------------------------------------+

_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________