[Image-SIG] Loading OpenType font (PIL 1.1.5, Python 2.4.1, Windows XP)

Fredrik Lundh fredrik at pythonware.com
Fri Sep 16 16:45:24 CEST 2005


Laszlo Zsolt Nagy wrote:

> This two liner:
>
> import ImageFont
> font = ImageFont.truetype('arial.ttf',14)
>
> Gives me this error:
>
> Traceback (most recent call last):
>  File "T:\Python\Projects\PILTest\test.py", line 2, in ?
>    font = ImageFont.truetype('arial.ttf',14)
>  File "C:\Python24\Lib\site-packages\PIL\ImageFont.py", line 202, in
> truetype
>    return FreeTypeFont(filename, size, index, encoding)
>  File "C:\Python24\Lib\site-packages\PIL\ImageFont.py", line 121, in
> __init__
>    self.font = _imagingft.getfont(file, size, index, encoding)
> TypeError: function takes at most 3 arguments (4 given)
>
> What am I doing wrong?

make sure _imagingft.pyd is the one that came with PIL 1.1.5, and
not some earlier version.  to see what pyd it's using, do this:

    >>> import _imagingft
    >>> _imagingft.__file__

</F> 





More information about the Image-SIG mailing list