ingenuitas/SimpleCV — Issue #18: Can't set font for blitting unicode text
Author: mcandre
Created: 2012-03-03 16:10:45+00:00
State: open

I'd like to blit Japanese text onto an image, but it shows up as a bunch of rectangles.

I try setting the font to Arial, a unicode font, but that results in an IOError.

Code:

SimpleCV.Font().setFont("/Users/andrew/Desktop/src/sensei/arial.ttf")

Trace:

Traceback (most recent call last):
File "./sensei.py", line 51, in
main()
File "./sensei.py", line 19, in main
SimpleCV.Font().setFont("/Users/andrew/Desktop/src/sensei/arial.ttf")
File "build/bdist.macosx-10.7-intel/egg/SimpleCV/Font.py", line 49, in __init__
File "build/bdist.macosx-10.7-intel/egg/SimpleCV/Font.py", line 78, in setFont
File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 218, in truetype
return FreeTypeFont(filename, size, index, encoding)
File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 134, in __init__
self.font = core.getfont(file, size, index, encoding)
IOError: cannot open resource