Op Dinsdag 2007-12-18 skryf A.T.Hofkamp: > Lennon Cook wrote: > > "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > >> For a fixed font, take any character, query its width and height, > > How would I do this? > > For text in 'self.name', I do > > pango_layout.set_text(self.name) > xlen_text, ylen_text = pango_layout.get_pixel_size() > > and that seems to work. > > > > Albert
I've also done this and it works. An issue I'm having with this is that I'm limiting the width of the textarea and use wrapping. gtk.Layout.get_pixel_size() does not take the wrapping into consideration, but gives the width and height based on an unwrapped layout. How can this be addressed? Surely pango knows how wide and high it will be with the wrapping enabled. Any help appreciated. Friedel _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/