[cairo] cairo_font_face_t not freeing

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon May 22 23:50:38 UTC 2017


On Mon, 22 May 2017 13:59:43 +0200, Fred Bca wrote:

> hfonts are not reference counted, and as far as I remember, cairo
> fonts created using this API will not destroy the hfont (and that's
> the expected behavior), hence the lifecycle issue ...

Couldn’t you use the same workaround as with FreeType fonts?

In the early days of Cairo, these were not reference-counted either
(they are now). But cairo_ft_font_face_create_for_ft_face cannot be
changed to add a call FT_Reference_Face without introducing a
backward-incompatible alteration in the semantics. So the caller has to
resort to the user-data dance documented here
<https://www.cairographics.org/manual/cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-ft-face>.


More information about the cairo mailing list