Get Text width method?

Hi all,
Does anyone have a trick for calculating the width of a string in a specified font?
That would be very handy for constructing a rectangle or a bubble that automatically wraps around text tags.

Rhino does have bounding box functionality for 3dtext, but you’ll need some c# or python to get at that.

2 Likes

Hi guido
You can use the Bubalus_GH plugin.I hope this helps you.
Gh file:textBoundingbox.gh (14.5 KB)



2 Likes

You can use the component that is in this discussion to calculate a bounding box
The only thing you need is to get the correct font used by Grasshopper, it is in Preference/Grasshopper Settings. Segoe UI for me


Size font text tag.gh (13.8 KB)

2 Likes