Hello Java Fans,
my question is, if there is an method or something equals, to calculate a FontSize to draw a text which must fit to a given Width or Height?
For example, if we have a area which is 200px width and we have a text like “This is a text” which we will draw with the font (yx) and these text should fit in the area with 200px width.
I haven’t found something in FontMetrics but maybe there a other solutions?
The first witch i think is the bisection method to set a Size and get the Width witch FontMetrics’ getStringWidth…, but i think this is very inefficient.
thx and sorry for my bad English