I wrote:
> a glitch, at least. the _imagingft driver appears to use Python's
> default encoding, rather than the filename encoding.
>
> should be relatively easy to fix, I think
For the record, here's a (preliminary) patch:
$ svn diff _imagingft.c
Index: _imagingft.c
=
> should be relatively easy to fix, I think, but in the meantime, you'll
> have to work around this by making a temporary copy of the file with a
> made-up name if this happens:
Thanks for the feedback and the idea.
\d
___
Image-SIG maillist - Image-SI
Donn wrote:
> Trying to open a ttf file with a non-standard character in it (u'\xe5')
> causes an error, no matter what I pass to encoding:
> self.font = _imagingft.getfont(file, size, index, encoding)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position
> 66: ord
> I don't know, but may be PIL needs to have the Byte Order Mark for handling
> unicode.
Not 100% sure what you are saying.
That character is ( I don't know if it will travel ) "å" and I can open files
that contain it with my other python stuff like codes.open etc.
Are you suggesting a solution
Hello,
Trying to open a ttf file with a non-standard character in it (u'\xe5')
causes an error, no matter what I pass to encoding:
enc="unic"
enc="unicode"
enc="utf8"
etc.
font = ImageFont.truetype( paf, 64, index=i , encoding=enc )
The error:
File "/usr/lib/python2.5/site-packages/PIL/ImageF