Re: R: text extension problem



"Ricchetti, Andrea" <Andrea Ricchetti snapon com> writes:

> 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);

Perhaps someone else knows what you mean.  I'm not sure that I
understand.

It sounds like you want Pango to return the width & height that were
used to determine how the text was laid out (wrapped).  You can get
this from pango_layout_get_width() and pango_layout_get_height().  But
it seems like you must have set those values previously yourself.

There are three rectangles involved: the one used to lay out the text
(get_width/ get_height), the result of that layout (get_extents,
logical_rect or get_size), and the one that describes which pixels
will get painted (get_extents, ink_rect).  Each of these are in
PangoUnits, so they have fractional pixel values, and you might want
the values rounded up to whole pixels.  If what you want isn't one of
those 6 rectangles, then I don't know what it could be.

  --deh!

-- 
"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]