Java: Getting a font with a specific height in pixels -


it’s easy determine rendered height of font using fontmetrics, other way around? how can obtain font fit specific height in pixels?

"give me verdana in size 30 pixels high ascender descender."

how ask java this?

jen,

i don't think there's "direct" way find font height; indirect way... looping through sizes, , testing height of each <= required height.

if you're doing once, loop through them... if you've doing "on fly" binary search, it'll quicker.

cheers. keith.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -