Question

How can I get bounds of a text, provided string with attributes say, font size, font style, and font family in GTK+?

Was it helpful?

Solution

For GTK+, you should probably look at Pango. I believe the required call is pango_layout_line_get_pixel_extents(), although this will of course require you to parse whatever string it is you have with the specs, and set up the corresponding Pango object before getting the extents.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top