How to know if your Text element will create a new line?

I’m working on a dialogue system using Unity’s UI where text is printed 1 character at a time. This means that words near the right side on the Text element will begin printing on one line, and then be moved to a new line when the other characters are added. Ex: the word ‘Conversation’ below started on the top line, then was moved to the next line.

This is rather jarring. How would I measure the size of my Text element/line to see if this will happen, so I can manually insert my own new lines (

The Text component has a cachedTextGenerator property that you can use to find out information about the layout of generated geometry:

The lineCount property will give you the data you are looking for fairly simply, but you can also look directly at the vertices or characters to find out exactly how each glyph is positioned.