Re: high-level text drawing



On Saturday 27 December 2003 17:05, Johannes Weißl wrote:

How do I draw text as high-level as possible in GTK2?

something like this should work (here with a GtkDrawingArea):

PangoLayout *layout;

layout = gtk_widget_create_pango_layout(drawing_area, NULL);

pango_layout_set_text(layout, "some textt in utf8", -1);

gdk_draw_layout(drawing_area->window, pen, posx, posy, layout);

If you don't have the GtkWidget your drawable belongs to at hand, you'll 
probably need to use pango_layout_new() etc.  (not sure if there is a simpler 
way, I've only used gtk_widget_create_pango_layout so far).

Cheers
-Tim




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