#include #include #include #include int main(int argc, char *argv[]) { PangoContext *context; PangoFontMap *fontmap=NULL; PangoLayout *layout; int dpi = 96; g_type_init(); if (g_file_test("./pangorc", G_FILE_TEST_EXISTS)) putenv("PANGO_RC_FILE=./pangorc"); while (1) { /* create a font map */ fontmap = pango_ft2_font_map_new(); pango_ft2_font_map_set_resolution(PANGO_FT2_FONT_MAP(fontmap),dpi,dpi); /* create a context */ context = pango_ft2_font_map_create_context(PANGO_FT2_FONT_MAP(fontmap)); /* free the fontmap */ g_object_unref(fontmap); /* make a layout */ layout = pango_layout_new(context); #ifdef DO_LEAK PangoRectangle logical_rect; pango_layout_get_extents(layout, NULL, &logical_rect); #endif /* free the layout */ g_object_unref(layout); /* free the context */ g_object_unref(context); } return EXIT_SUCCESS; }