Re: DrawingArea and Text display.



Tony Denault:

>    Fixed_font = pango_font_description_from_string ("Fixed");
>    GC = gdk_gc_new(base_window->window);
> 
>    <stuck on how to display string in Drawing area using pango>

PangoContext *pcontext = gtk_widget_create_pango_context(widget);
PangoLayout *layout = pango_layout_new(pcontext);
char *utfForm = "Some UTF-8 text";
pango_layout_set_text(layout, utfForm, strlen(utfForm));
pango_layout_set_font_description(layout, Fixed_font);
PangoLayoutLine *pll = pango_layout_get_line(layout,0);
gdk_draw_layout_line(drawable, gc, x, ybase, pll);

   Neil





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