Is there any way how to determine the optimal canvas size for text rendering?
The input is a string with newlines, I want to contruct the canvas to fit (no insets) while using both font types – proportional and non-proportional, these types will be never mixed.
Thanks.
From the Java Tutorial Measuring Text
You probably need to do this line by line of your text and detect whether your font changes between lines.