[cairo] Loading font from a file in pycairo

Michael Droettboom mdroe at stsci.edu
Fri Aug 10 11:36:44 PDT 2007


I'm making some improvements to the Cairo backend in matplotlib and I 
have question about font loading.

matplotlib has its own font-finding infrastructure, and most of the 
rendering backends load fonts by a filename returned from that system. 
Is there any way to load a font by its filename in pycairo?

It looks like it is possible in C to load a freetype font with 
FT_Open_Face and then use cairo_ft_font_face_create_for_ft_face.  Is 
freetype always assumed to be on all platforms, or would one have to use 
cairo_win32_font_face_create_for_hfont, for example, on Windows?

Are there any thoughts about exposing this in pycairo?  Is this just a 
bad idea for reasons that I might be missing?

Cheers,
Mike


More information about the cairo mailing list