How to Resizing text with pango



I have chosen to resize some text that will be rendered to a drawable without
using the parse markup method.  My code is:

PangoAttribute *size = pango_attr_size_new(36 * PANFO_SCALE);
PangoLayout *layout = gtk_create_pango_layout(widget, "text");
pango_attr_list_insert(list, size);
pango_layout_set_attributes(layout, list);

Then I call either gdk_draw_layout or gtk_paint_layout
Everything compiles and works more or less except the size of the text never
changes, it is always the default size which seems to be 12 point size.

The only way I can get the size to change is by putting the above code in an
expose event callback.  When the widget has to be redrawn then the size I have set takes 
effect.  Even then on some redraws the size reverts back to the
default 12 point size then back to the size I set on the next redraw.

What have I left out or done wrong, or is this the way text resizing works
when the markup method is not used?




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