problems with PangoFT2 -- help anyone ?



Hi,

I have rewritten large parts of app/widgets/gimpfontselection-dialog.c
in the HEAD branch of gimp to follow the Pango API changes. The code is
in large parts copied from GtkFontSelection but either I have a stupid
bug in my code or PangoFT2 is playing tricks on me. I have stared at 
the code for some hours and threw the debugger on it and I slowly come
to the conclusion that PangoFT2 does some unexpected things that bite
me. I'd be happy if someone with more insight could comment on this.

Basically, what the code does is to use
   pango_context_list_families (context, &families, &n_families);
with a PangoFT2 context. This seems to work fine and I store the array
of families for later use just as GtkFontSelection does. Later when
a font family is selected, the code calls
   pango_font_family_list_faces (family, &faces, &n_faces);
using a family pointer out of the array of stored families. Even though
calling pango_font_family_get_name() on the same family pointer seems
to give the correct result, the array of faces returned by 
pango_font_family_list_faces() is sometimes totally borked and gimp dies 
shortly after when it tries to access one of these faces as a
PangoFontFace.

What makes me think that the bug is not in my code is the fact that
it works sometimes. I suspect that the family pointers I hold become
invalid due to some caching mechanism. To prevent this from happening,
I tried to ref each PangoFontFamily in the array, but to no avail. If
someone wants to have a look at the code, it's in 
gimp/app/widgets/gimpfontselection-dialog.c.


Salut, Sven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]