Re: DrawingArea and Text display.



On Fri, Mar 07, 2003 at 12:45:51PM +0100, Sven Neumann wrote: 
> or slightly simpler and good for multi-line strings as well:
> 
>  PangoContext *context = gtk_widget_create_pango_context (widget);
>  PangoLayout  *layout  = pango_layout_new (context);
> 
>  g_object_unref (context);
> 
>  pango_layout_set_font_description (layout, font_desc);
>  pango_layout_set_text (layout, "Some UTF-8 text", -1);

Even better: 

 layout = gtk_widget_create_pango_layout (drawing_area, "Some text");
 pango_layout_set_font_description (layout, font_desc);

Also, be sure to check out the porting docs:

 http://developer.gnome.org/dotplan/porting/
 http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html

Havoc



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