30 May
2012
30 May
'12
5:41 p.m.
On Tue, 2012-05-29 at 16:31 -0700, mathog wrote:
What objects/methods would one extract the list of character widths (kerns?) for a text string starting from its Style?
You can create a text box and grab it's bounding box, which should be roughly the width of drawing needed. If you're just looking for the number on a non-canvas related way you can use Pango. Here's some code that does that in indicator-datetime:
http://bazaar.launchpad.net/~indicator-applet-developers/indicator-datetime/...
We're getting the font description from the GTK Style, but you could build your own as well.
--Ted