R: text extension problem


I've try what you have suggested, but the value that I got from "your" function are the same of my function.
I've made some test, and I've found that the correct width and height value are these from 

cairo_image_surface_create (CA_GetFormat(), _TextBoxWidth, _TextBoxHeight);

the base function that I've to invoked. I've made a program where these value (_TextBoxWidth, _TextBoxHeight) are output value.

Is this a correct way?

Thanks in advance.

-----Messaggio originale-----
Da: David E. Hollingsworth [mailto:deh curl com] 
Inviato: martedì 4 agosto 2009 19.21
A: Ricchetti, Andrea
Cc: gtk-i18n-list gnome org
Oggetto: Re: text extension problem

pango_layout_get_size() returns the logical (layout) size.  It sounds
like you want the ink size (which pixels will be touched when
rendered).  To get the exact ink bounds, call
pango_layout_get_extents(), passing in a non-null ink_rect and a null
logical_rect.  pango_layout_get_pixel_extents() is a convenience
function that expands the result to pixel boundaries.  Look at the
implementations in pango-layout.c and you'll see the relationship
between these functions.


"I've just found the silverware and I'm sticking a fork in that square!" - N.H.

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