Make text as large as possible, within boundary dimensions?

Is there a way in Processing to autoscale the text size to the largest possible that will fit into the text box boundaries?

In my case, I want to display a string from a large set of strings onto the screen. They vary is length from two or three words to dozens.

I see in the reference that Text() will not display the text if it gets too large--is there deeper documentation for Text()--perhaps it sends an error code of some sort when it does this which I can then utilize by starting with very large font sizes (that will fail) and iteratively getting smaller until it does fit? Or some other way?

I'm guessing this question has been asked before but I couldn't find anything via search.

Tagged:
Sign In or Register to comment.