I forgot how to find the width of Static Text given the font and the fontsize before drawing it? Can’t find the info, probably bad search terms.
See String method .bounds, e.g.
"my string".bounds(Font.default);
I was actually looking for QtGUI.stringBounds (I found it in some old code), but I see that your suggestion yields the same result. Thanks.
Pedantic, but I think better to call GUI.stringBounds than QtGUI.stringBounds? (This is what the string method does.)
1 Like
Excellent! I didn’t know this was actually available, this is something I missed for years . Thanks for the info.
1 Like