Monday, 2 September 2013

pango_itemize go into infinite loop

pango_itemize go into infinite loop

below is snippet, when run to pango_itemize, program into Infinite loop
and print :(process:6059): GLib-GObject-CRITICAL **: g_object_get_qdata:
assertion `G_IS_OBJECT (object)' failed.
anybody help me? thanks a lot.
const char **ptext;
PangoFontMap *fontmap;
PangoContext *context;
PangoLayout *layout;
PangoFontDescription *desc;
PangoFont *font;
GList* items;
context = pango_context_new();
const char *ss = "abc123";
int size = strlen(ss);
desc = pango_font_description_from_string("Sans");
if (desc != NULL)
{
pango_font_description_set_weight(desc, PANGO_WEIGHT_NORMAL);
pango_font_description_set_size (desc, 24 * PANGO_SCALE);
} else{
printf("desc failed!\n");
}
items = pango_itemize(context, ss, 0, size, NULL, NULL);

No comments:

Post a Comment