[cairo] Text rendering crash

Behdad Esfahbod behdad at behdad.org
Mon Oct 20 09:10:43 PDT 2008

Ian Britten wrote:
> Behdad Esfahbod wrote:
>> Your guess is exactly what's happening.  The docs have been enhanced to point
>> this out with an example.  See:
>> http://cairographics.org/manual/cairo-ft-font.html#cairo-ft-font-face-create-for-ft-face
>> Now I don't know how the FreeType cache manager supports that.  Perhaps David
>> can answer.
> I wouldn't want to speak as a FT maintainer, but my basic understanding
> is that "No, it doesn't".  I think the cache just frees up whatever it
> wants, whenever it needs to.
> Given that assumption, I'm finding myself in a bind, unsure how to
> proceed.  I did some thinking over the weekend, but most of my thoughts
> required intrusive changes to Cairo, which I suspect you're probably
> not interested in...
> eg:
> - Change Cairo to work with FT_Glyphs rather than FT_Faces, as there
>    seems to be a FT_Glyph_Copy() which presumably could be used keep
>    copies of the glyphs (even if the FT_Face is deleted).
> - Ask FT for a new FT_Face_Copy(), but again, Cairo would have to be
>    enhanced to use it.
> - Add some sort of hook (callback) to Cairo for when it needs the
>    FT_Face again.  The default implementation would do whatever it
>    currently does, but I could provide my own callback which would
>    re-fetch the FT_Face from the FT cache.  Again though, this would
>    be changes to Cairo.
> - etc

- Don't use FreeType cache.

- Add refcounts to FreeType objects.

I've never seen anyone use that before BTW.

> In other words, there's various approaches that could be discussed, if
> minor/extensive changes are made.  However, I'm not seeing much of a
> solution given the currently-available APIs (from both Cairo and FT).
> Does anyone out there use the Cairo/FreeType font stuff much/any?  If
> yes, do you use it with the FT Cache?

Sure, Pango builds a full tet rendering engine on top of it, but it doesn't
use the FT Cache, no.

> As always, any thoughts or suggestions are appreciated!
> Ian


More information about the cairo mailing list