[cairo] Text rendering crash
britten at caris.com
Mon Oct 20 05:27:05 PDT 2008
Behdad Esfahbod wrote:
> Your guess is exactly what's happening. The docs have been enhanced to point
> this out with an example. See:
> 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...
- 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.
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?
As always, any thoughts or suggestions are appreciated!
More information about the cairo