Re: Obtaining area needed to render a text



On 10/4/06, Gustavo Cipriano Mota Sousa <gustavomota inf ufg br> wrote:
I am developing an application where I need to render some objects in a
DrawingArea, among with them are some text labels. I'd like to know in
advance how much area (width/height) would be needed to render a text. Also,
I am using cairo to render.

Something like:

       char *text;
       int width, height;

       PangoLayout *layout = gtk_widget_create_pango_layout(
               GTK_WIDGET( drawingarea ), text );
       pango_layout_get_pixel_size( layout, &width, &height );
       g_object_unref( layout );

John



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