Gnomecanvas/TextItem question



I wrote a program in perl using gtk1 that is used at my church (and
others) for displaying the song lyrics on a projector during church.
The page is http://www.adebenham.com/lds/
I am moving to Gtk2 for it and have almost got everything working
(actually due to gtk2s' coolness I have added features :-) but I am
stuck on one item ... Finding the dimensions (in pixels) for a text item
that will be put on a gnomecanvas.
The reason for needing this is the app allows for adding bible verses
and it automatically figures out how many verse will fit on a single
screen and splits it accordingly.
Previously I did it by creating a Gtk::Gdk::Font with the font set
accordingly then used string_width to find wrapping and fudged a value
for string_height.
This doesn't seem to work anymore.

Basically, how do I find the height of a arbitrary string for a given
font and given maximum width?

Thanks,
 Chris

BTW the page for my gtk2 version is http://www.adebenham.com/lds/lds2.html




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