Re: proper way to get cairo font width



Hi Tommi,

Hi Stefan :)

Hello. What is the best way to query font width from cairo, in case that I
want to set size_hint for the widget that is drawing with that font?

would it help to construcz PangoLayouts and use pango_layout_get_extents().

I think I started some experiments already with Pango, but didn't progress very far. But for now, I can live with the 'ugly' way and think some smarter way later on.

Next step is to find how to store the rendered text as pixmap/image and use that instead of every time rendering the text, because that seems to be awfully slow. And since I know when the text has to be rendered again and when I can use the pixmap (for eg. scrolling when text does not change, only the position), this is the best approach.


Tommi



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