how to clear the freetype face cache?
Vojtech Fried <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
>So my question is: is there any way to tell cairo to clear its font cache and release those cairo_font_face_t objects? I am not sure if this is what you want, but... You can register a "destructor" function (calling FT_Done_Face) after you create cairo_font_face_t with cairo_font_face_set_user_data. I am not sure about multithreaded scenario, however. Can thread A use a cached cairo_font_face_t created by a thread B? Can A kick B's cairo_font_face_t out of the cache? You have also to be careful about your FT_Libraries and only free them after all its faces are freed. Which means you can keep it alive with something like a shared_ptr held with the cairo_font_face_t destructor function above. Vojtech -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo