#include	<stdio.h>
#include	<string.h>
#include	<pango/pango.h>

int	main(int k, char *p[])
{
PangoAttrList *list = NULL;
char *text = NULL, markup[100];
GError *error;
PangoAttrIterator	*patr;
gint	start, end;
PangoFontDescription	*desc;


error = NULL;

strcpy(markup, "<i>Hello</i><span font_desc=\"20\"><i>world</i></span>");
//strcpy(markup, "<i>Hello</i><span font_desc=\"20\" style=\"italic\">world</span>");
//strcpy(markup, "<i>ab</i> <span font_desc=\"20\" style=\"italic\">world</span>");

if (pango_parse_markup(markup, -1, 0, &list, &text, NULL, &error))
	{
	patr = pango_attr_list_get_iterator(list);
	do
		{
		pango_attr_iterator_range(patr, &start, &end);
		printf("range: %d-%d\n", start, end);

		desc = pango_font_description_new();
		pango_attr_iterator_get_font(patr, desc, NULL, NULL);
		printf("desc = %s\n", pango_font_description_to_string(desc));

		pango_font_description_free(desc);

		printf("\n");
		}
	while (pango_attr_iterator_next(patr) == TRUE);
	pango_attr_list_unref (list);
	}
else
	g_warning ("%s: %s", G_STRLOC, error->message);
return 0;
}
