[cairo] Freetype to Cairo - newb needs help

Donn donn.ingle at gmail.com
Tue Oct 23 13:58:01 PDT 2007


> > Would I have a good argument (or not?) when I say:
> > 1. Part of Cairo wraps Freetype (to a certain extent) already.
>
> No, this is not correct.
Excuse my use of terms, I'm an amateur. I meant "wrap" to mean "it has 
functions that do stuff with" Freetype.
I specifically mean these:
cairo_ft_font_face_create_for_ft_face                                         
cairo_ft_font_face_create_for_pattern
cairo_ft_font_options_substitute
cairo_ft_scaled_font_lock_face
cairo_ft_scaled_font_unlock_face

> > 2. Cairo faces can be made directly from FT faces in c/c++
> > 3. PyCairo wraps Cairo.
> > Therefore:
> > 4. Pycairo should also offer Python versions of the FT->Cairo functions.
> > ?
> It should, but there's no PyFreeType, that's why PyCairo doesn't do
> that.
I can see that in one way, but in another: Pycairo *could* be a one-for-one 
conversion of each Cairo function and therefore those Freetype functions 
could also be exposed. Sure, there would be no FT_New_Face until a pyFreetype 
is written, but at least the Cairo end of the Freetype deal would be there.

Then, with a little voodoo, we could use the ctypes trick to get an FT_Face 
and pass that directly into the (now imaginary) 
cairo.freetype.cairo_ft_font_face_create_for_ft_face() function.

Unless that's already the case, but I did give it a stab and had no joy 
finding that function.

/d


More information about the cairo mailing list