#include <gtk/gtk.h>

#include <pango/pangocairo.h>

int
main (int argc, char **argv)
{
	PangoContext* pango_context;
	PangoLayout* pango_layout;
	PangoFontDescription* font_description;
	cairo_font_options_t *font_options;
	int i;

	g_type_init ();

	font_description = pango_font_description_new ();
	pango_font_description_set_family (font_description, "Sans");
	pango_font_description_set_size (font_description, 6*PANGO_SCALE);

	pango_context = pango_cairo_font_map_create_context ( PANGO_CAIRO_FONT_MAP (pango_cairo_font_map_get_default ()) );

	pango_layout = pango_layout_new (pango_context);
	pango_layout_set_font_description (pango_layout, font_description);

	font_options = cairo_font_options_create ();
	cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF);
	cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);

	pango_cairo_context_set_font_options (pango_context, font_options);

	cairo_font_options_destroy (font_options);

	for (i = 50; i < 100; i++) {
		int width, height;
		pango_cairo_context_set_resolution (pango_context, i);
		pango_layout_set_text (pango_layout, "Hello World!", -1);
		pango_layout_get_size (pango_layout, &width, &height);
		printf ("%i ; %i ; %i\n", i, width, height);
	}

	pango_font_description_free(font_description);
	g_object_unref(pango_layout);
	g_object_unref(pango_context);
}
