Pango FontDescription -> FontMetrics: HOW?



Hi,

I want to get_approximate_char_width() so as to limit the width of a widget (TreeView) according to a given number of characters.
The problem is I access the current font for a given widget in this way:

widget->get_style()->get_font()

that returns a Pango::FontDescription object

but the function "get_approximate_char_width()"  applies on a Pango::FontMetrics object

--> How can I get the FontMetrics from the FontDescription??
I have spent some time with the gtkmm documentation but i can't find how I can get a FontMetrics class from
a Pango::FontDescription.

or maybe should i access the current font used for the widget in another way (that returns something else than a FontDescription)??

thanks for your help




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