[cairo] UserFontFace vs FtFontFace management (cairomm)

Ian Britten britten at caris.com
Tue Dec 2 12:53:45 PST 2008


Jonathon Jongsma wrote:

>> [ NB - I'm pretty sure this is cairomm-specific ... ]

>> Are users supposed to be able to create+manage UserFontFace
>> objects the same way as FtFontFace objects?  If yes, then I'm
>> wondering about a crash I'm seeing...
>> [ If no, then the docs should maybe clarify the difference ]

>> (*) The problem, as reported by Valgrind, seems to be that
>> Cairo::UserFontFace::render_glyph_cb() (fontface.cc:287) is
>> accessing something that was deleted in
>> Cairo::UserFontFace::~UserFontFace()() (fontface.cc:330).
>> [ I can provide full traces, if necessary ]

> It's quite possible that you've hit a bug since this stuff was only 
> implemented in cairomm recently (and I've held off on releasing a stable 
> 1.8.0 of cairomm precisely because this stuff hasn't been well-tested 
> yet).  In fact, you're very likely the first person to have tried to use 
> it.  I will look into it.

Hmmm...  If that's the case, is the interface still open to
discussion/change?  :)

As I've start trying to use it, I got wondering if it wouldn't
make more sense (and be more C++-like) for UserFontFace to be
an abstract class, with a pure-virtual 'render()' method, and
virtual 'init()', etc, methods?
I'm just working through setting up the function pointers, and
trying to decide where to store my client-data (requiring a
separate struct, etc), and got thinking that if I could simply
derive from UserFontFace and carry my extra information in my
own derived implementation, it would probably simply things.

Anyways, just some initial thoughts...
Ian



More information about the cairo mailing list