cairo mathtext

When looking through the backend_cairo.py code, I realized that it currently renders the mathtext as images. While this is currently fine, as cairo's export of PS is really just an image, it would be better in the future to actually have it draw the fonts as paths.

My first approach was to hack 'draw_mathtext.py', and to go and draw the strokes for the glyph's paths. The commands that the glyphs allow are (according to ft2font.cpp) are: MOVETO=0, LINETO=1, CURVE3=2, CURVE4=3, ENDPOLY=4. It seemed fairly simple, as cairo has the commands: 'move_to(x, y)', 'line_to(x, y)', and 'close_path()'. I wasn't sure if move_to and line_to were the equivalents of this, or actually 'rel_move_to' and 'rel_line_to'. Also, I wasn't sure how to map CURVE3 onto cairo's 'curve_to' (admittedly I know very little about these types of curves).

If anyone has any suggestions on how to do this, it would be greatly appreciated. I also realized halfway through that perhaps it was a better idea to instead use cairo's truetype font ability, and if there weren't a simpler method to do this..

Thanks!

Abe