Thanks, Nicolas--this is going to help a lot! Forwarding to the list as well. Regards Stéfan On Sun, Aug 26, 2012 at 6:20 AM, Nicolas Rougier <Nicolas.Rougier@inria.fr> wrote:
Hi,
I've tried to post to the mailing list but for some reason my message did not appear (feel free to forward this one to the list).
For text, there are the freetype-py bindings available from http://code.google.com/p/freetype-py/
Be sure to check the example directory that explain how to render text once you've chosen a font file. By default, I generally use the Bitstream Vera family that might be BSD compatible (but I'm not so sure).
Also, there is a nice article on text rendering: http://www.antigrain.com/research/font_rasterization/ The "agg_trick.py" demo does just that.
In the end, you get a RGBA array with the text within so it should be easy to add it to an image.
Also, I read you need bezier curves and I recently translated the bezier curve code from the antigrain library:
http://www.antigrain.com/research/adaptive_bezier/index.html
You can find at http://code.google.com/p/gl-agg/source/browse/python/gl-curve.py two functions:
curve3_bezier( P1, P2, P3 ) and curve4_bezier( P1, P2, P3, P4) that takes respectively 3 and 4 points as input and will give you back a list of points. If you draw straight lines between those points, then you're done with bezier.
Nicolas
participants (1)
-
Stéfan van der Walt