How do I draw "Best-Fit" text inside of a rectangle?
posted 6 years ago
I simply want to draw text inside of a rectangle. Easy. Harder: I would like the text to be as readable (translate: big) as possible with the constraint that it must be contained in the rectangle. I know about getAscent() and getDescent() and how to iterate through font types and sizes to find something that fits. But is there a more efficient / existing code for finding best font size to render a text string in a rectangle so that it is as readable as possible?