Drawbot is a well known library to write simple Python scripts to generate two-dimensional graphics. It also has sevaral use in typeface design. The builtin graphics primitives support rectangles, ovals, (bezier) paths, polygons, text objects and transparency.
DrawBot is an ideal tool to teach the basics of programming. Students get colorful graphic treats while getting familiar with variables, conditional statements, functions and what have you. Results can be saved in a selection of different file formats, including as high resolution, scaleable PDF, svg, movie, png, jpeg, tiff… DrawBot has proven itself as part of the curriculum at selected courses at the Royal Academy in The Hague.
Drawbot, however, only works in Mac. Recently Drawbot Skia project tries to make it platform independent.
Here is an example using drawbot-skia to render Malayalam. I will try to update as the project get more features.