Forum Archive

Pillow seems to break TrueType loading

ccc

@omz, It is awesome to have Pillow in build 160033!! Congratulations on this major step forward!

from PIL import ImageFont
# each of the remaining lines fail
font = ImageFont.truetype('<System>', 15)
font = ImageFont.truetype("Arial", 15)
font = ImageFont.truetype('Helvetica', 20)
Webmaster4o

Was just about to post this issue.

Webmaster4o

Posted anyway, because I wanted to post the error it was throwing and I didn't want to delete my already-written post.

omz

I forgot that I had patched PIL to make that work, should be easy to use the same technique in Pillow.

Webmaster4o

Great! looking forward to it.

omz

Quick workaround:

import _font_cache
font_name = 'Helvetica'
font = ImageFont.truetype(_font_cache.get_font_path(font_name))