Re: get_size of a layout with wrapping enabled



Op Donderdag 2007-12-20 skryf Behdad Esfahbod:
> On Thu, 2007-12-20 at 20:30 +0200, F Wolff wrote:
> > Hi list
> > 
> > I'm trying to obtain the size of a layout with get_size and all is fine.
> > However, since I have wrapping enabled, in the case of long lines, the
> > layout is drawn with wrapped lines, but this is not reflected in
> > get_size - it seems to always return the size of drawing the layout with
> > unwrapped lines. I need to know the size that the layout needs to render
> > according to my parameters (which includes wrapping, my provided width,
> > attributes, etc).
> > 
> > (I have pango 1.17.1 installed, if it makes a difference)
> > 
> > Am I missing something obvious? Any help will be appreciated.
> 
> What you describe happens if you have not set width on the layout.

Thank you for the reply. I'm still puzzled. Here is the current sequence
of events:

new layout
set_wrap(WRAP_WORD_CHAR)
set_width(width)
set_markup(markup)
get_pixel_size()

Later I draw it and the requested wrapping and width works correctly, so
things seem to work, although I guess I'm obviously doing something
wrong somewhere.

Is there a problem with this sequence of calls?

Friedel



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