#include static cairo_status_t render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics) { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_A8, 10, 10); cairo_surface_mark_dirty (surface); cairo_pattern_t *pattern = cairo_pattern_create_for_surface (surface); cairo_save (cr); cairo_mask (cr, pattern); cairo_restore (cr); cairo_pattern_destroy (pattern); cairo_surface_destroy (surface); return CAIRO_STATUS_SUCCESS; } int main (int argc, char *argv[]) { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 100, 100); cairo_t *cr = cairo_create (surface); cairo_font_face_t *font_face = cairo_user_font_face_create (); cairo_user_font_face_set_render_glyph_func (font_face, render_glyph); cairo_set_font_face (cr, font_face); cairo_glyph_t glyphs[1] = {{0, 0, 0}}; cairo_glyph_path (cr, glyphs, 1); return 0; }