0

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

unwind
  • 391,730
  • 64
  • 469
  • 606
boom
  • 5,856
  • 24
  • 61
  • 96

1 Answers1

3

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.

unwind
  • 391,730
  • 64
  • 469
  • 606