[cairo] how to clear the freetype face cache?

Cosmin Apreutesei cosmin.apreutesei at gmail.com
Thu Jun 13 02:13:32 PDT 2013

> You can register a "destructor" function (calling FT_Done_Face) after you create cairo_font_face_t with cairo_font_face_set_user_data.

Thanks, I missed that part of the manual. I'll do that.

I would still like to have the possibility to clear cairo's font cache
because in my scenario (Lua binding of freetype and cairo) objects are
tied to the garbage collector so FT_Done_Library is called
automatically when the program ends. Now I have to say in the manual
that you are not allowed free a FT_Library object once you tie
freetype fonts to cairo, so you better untie it from the garbage
collector after you create it. It looks like an unnecessary hack from
the user's pov.

More information about the cairo mailing list