Java: Is there a linear correlation between a font's point size and its rendered extent? -


let's string rendered 10-point font 200 pixels wide. if draw same string 15-point font (a 50% increase), rendered width increase 50% (to 300 pixels)?

(of course, assumes no other changes in font , graphics2d text rendered.)

in other words, there direct linear relationship between font's point size , size text rendered? or there other variables prevent me making such assumptions?

you're close assumption.

however, spacing between letters doesn't scale exactly. believe has integer division having remainder, haven't looked @ java fontmetrics class code in while.

you're safest creating new font appropriate font size, , calling getstringbounds method on fontmetrics class.


Comments