[cairo] User font callbacks and user data

Chris fltk at functionalfuture.com
Fri Oct 3 06:41:29 PDT 2008


I noticed there were some user-font callbacks added in 1.8:
  cairo_user_font_face_set_init_func
  cairo_user_font_face_set_render_glyph_func
  cairo_user_font_face_set_text_to_glyphs_func
  cairo_user_font_face_set_unicode_to_glyph_func

I'm trying to implement these in a scripting language but I'm having 
trouble because unlike the other callbacks these do not seem to have a 
"user data" parameter.  This is necessary to proxy the C function call 
to a function in the scripting language.

At first I was thinking I could set a user data on the font face but 
then I realized that might not work because when the callbacks are 
called they are using a scaled font type and not a font face.

Now I could be thinking about this incorrectly and I admit I don't 
exactly know what these functions are used for because I haven't tried 
using them in an application.  Are these functions meant to be set 
per-font-face or are they meant to be global?  I'm thinking they are 
per-font-face which means I need to associate some user data with the 
callbacks.   Any ideas?

-- 
// Chris


More information about the cairo mailing list