How to know the font size, if in "Best fit" mode ?

my program has an input field, where I type a text and it writes on the screen, I put it in “Best fit” mode so that it works with different resolutions, but if I type a very large text, it will have a small font, I need to find a way that, before the text diminishes the font, breaks the line.

With: Text.cachedTextGenerator.fontSizeUsedForBestFit

This attribute is an integer. With this attribute you will be able to know the font size.