Is there any way to get the size of UI text, such as when using layout.label(text="message")?
I'm trying to create a simple message box popup that displays variable text, but the string is cut in the usual Blender way: "start...end". Which is really cool - its great for condensing UI controls into small spaces. But I'm just wanting to break the lines of text to fit into the box space.
There is a similar question here: Wrap text within a panel but no answers other than hard-coding the font size. And that is my primary question - how to obtain the text or font size? Or how to size the window around it?
I would really like to avoid hard-coding the glyph/text size. I'm assuming Blender does not use exactly the same font size on every display size? And there are also options for the user to set a different font for the interface. So guessing the size would break down pretty easily.
How is making a textbox usually done? Do we have to manually insert line breaks at every so many characters based on the window size? It's hard to imagine Blender implementing such a cool text condensing feature and then not including a simple one like text wrap? Maybe there is some other label() like function?
If not, has anyone managed to write your own text wrap type function that is reliable across different displays and user settings?