RE: high-level text drawing



So many functions need to call to draw a string, it is very slow.
I tried with the directly Xdrawstring, the Pango is 600 times slower.
If there is no simpler way to do this, that will be too bad.





-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-admin gnome org] On Behalf Of Tim Müller
Sent: Saturday, December 27, 2003 3:20 PM
To: Johannes Weißl; gtk-app-devel-list gnome org
Subject: 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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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