Install Aggdraw with Freetype Support

I am trying to compile an Aggdraw drawing module for Python 2.7 with Freetype text rendering support on Windows. The problem is that, despite the fact that I do everything according to the book, I still get an error message that there is no font renderer:

Traceback (most recent call last):
  File "C:\Users\BIGKIMO\Desktop\fdsfdf.py", line 9, in <module>
    font = Font('black', r'C:\Windows\Fonts\Georgia.ttf')
IOError: cannot load font (no text renderer)

I read the previous posts about this, as well as these steps:

  • Downloaded precompiled version of Freetype 2.3.5
  • Points the variable FREETYPE_ROOT in the setup.py script file to the freetype folder path ("C: /.../ Desktop / freetype-2.3.5")
  • Installed aggdraw by typing cd path/to/folder/of/setup.pyand thenpython setup.py install

The script setup seems to accept the freetype location that I give it and does not complain that freetype is disabled, so I would think that Aggdraw Freetype support is installed.

Mac, 64- Aggdraw, Freetype, Aggdraw Freetype, .

, , :

from PIL import Image
from aggdraw import Draw, Brush, Pen, Font

size = 500, 500
img = Image.new("RGBA", size)
draw = Draw(img)
draw.rectangle((0, 0) + size, Brush((255, 255, 255), opacity=255))
draw.setantialias(True)
font = Font('black', r'C:\Windows\Fonts\Georgia.ttf')
draw.text((100, 100), "hello, world", font)
draw.flush()
img.save("test.png")

? Freetype, ?

!

+4

All Articles