I’m not really sure if this is the right thing to do when there’s a newline in the string… What’s the context in which you’re having a problem with it?
Normally for non-trivial strings you’d want to measure it properly with something like GlyphArrangement or TextLayout rather that hitting these low-level functions. If we’ve used getTextWidth() internally in a place where we should have used something else, then we should change the calling code rather than this function.
My use case is to draw a rounded rectangle background for a Label which is showing info about the loaded sample in my VI when the mouse is over an instrument on The Stage:
I’d expect getStringWidthFloat() to account for the new lines or change the API docs to let us know that it doesn’t. I can’t think of any use case where the length should not account for the newLine?