| ★ wanayoo — archive 1999 http://starship.python.net/crew/kernr/Projects.html | Nouvelle recherche | Portail wanayoo |
I have used SWIG to wrap FreeType, a TrueType font rendering engine. With PyFT, you can render text onto a 2-color bitmap or render anti-aliased text onto a 256-grayscale pixmap. FreeType's "raster maps" interface well with PIL. One can convert a raster map to a PIL Image with only two function calls, one to get the image data and one to create a PIL Image from that data.
PyFT isn't yet a complete TrueType rendering solution (now). However, it sure isn't far.
Documentation of FreeType is at its web site. Documentation for PyFT is here
This is just a small extension module that will encode binary data into printable ASCII. It is intended for use in PDF file generation.
It uses Digicool's cStringIO module. It is included in Python's distribution. Those who build Python from source simply need to include it as one of the extension modules that they compile. Windows users have it pre-compiled in python15.dll.