The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Java Fonts

Posted by Rajesh Dubey on June 09, 2000 at 6:31 PM

A font is normally specified in Points and by default there are 72 points in an inch.
Hence a 10 point font should be of an height of 10/72 of an inch, but the getAscent and getDescent api returns value which makes the size of font much greater than that.
I wrote a simple program which draws the baseline, ascent, descent and leading for a string, for all fonts supported on the platform. I found that for every font there is a huge difference between the ascent returned by the Font metric and the actual height above the baseline.
I would like to know how can i acurately determine the font size in java and what does it consist of.
Thanks
Rajesh



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us