[cairo] Freetype to Cairo - newb needs help

Donn donn.ingle at gmail.com
Tue Oct 23 14:18:15 PDT 2007

On Tuesday 23 October 2007 22:43, Carl Worth wrote:
> On Tue, 23 Oct 2007 22:35:14 +0200, Donn wrote:
> Now, sometimes there are cases where it is not immediately practical
> to provide complete cairo bindings. For example, cairo has interfaces
> to create a surface for an Xlib object such as a Pixmap. These
> cairo-xlib interfaces are part of cairo and it would be useful to have
> them available in bindings. But there's a prerequisite there that
> there exist bindings for Xlib as well, (so that the application can
> create the equivalent of the Pixmap to use the cairo-xlib interface).

Sort of a "Python talks to Python the middle". I'm trying to grok your 
description, but I'm as dumb as paint :)

> PS. Frankly, from my point of view, (and having watched the
> machinations on this thread), it seems that the pain of "bindings not
> quite complete" can more than outweigh any benefits of not just coding
> in C in the first place.

Oh, I have been hacking c/c++ Python extension tests for a day. So far all I 
get are segfaults. I contacted the author of the old pyft2 wrapper and I sent 
him my code, perhaps he'll weigh-in sometime too.

 The basic plan (with pinkie finger in corner of mouth) is to send a paf (path 
and filename) to the new module (foo) and have it open the FT_Face, bung it 
into a cairo face and then return that cairo face such that it works:

import foo
cr_face = foo.voodoo("/path/somefont.ttf")

So, it's not a Freetype wrapper, but a bridge between cairo and Python that 
carries cairo faces across it.

If anyone is keen to see my badly mutilated and deeply embarrassing code I'll 
send it on. Here's the FT2 wrapper that got me started. 

Oh and one last interesting module:google for pyglet-1.0alpha1 -- very cool 
ctype stuff going on there too. Have not had time to grok.

Thanks all,

More information about the cairo mailing list