• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Font Merics, playing Tricks.

 
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy! All!
Well,
I have noted that there seems to be some problem between the Rectangle2D objects' getHeight method.
The one in JDK 1.3 gives a height greater than that in JDK 1.4.
Has anyone else come across this problem??
Is there is a work around??
Am I alone??
Regds
Lupo

Output :
Compiler JVM Height Width
JDK1.3 1.3 13.0 48.0
JDK1.3 1.4 11.32 48.0
JDK1.4 1.3 13.0 48.0
JDK1.4 1.4 11.32 48.0
I wonder why the height is changing..
[ December 31, 2002: Message edited by: gautham kasinath ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not Rectangle2D, but the font metrics...

this bug report talks about it.

It says the state of the bug report is "In progress, bug", but the evaluation says they meant to do it, and that the 1.4 calculations are more accurate... shouldn't that be "Closed, not a bug" then?
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy!
Well, thanks for the tip mate!!
Anyway, the bug report says : "The 1.4 figure of "26" rounds up
only as much as necessary to ensure that an application client will
be able to calculate sufficient space to display the font.
"
But then the application displays the fonts better in 1.3 than in 1.4..
Actually I have a set of lines to display on a scrollpane. Now, to calculate and set the height of the scrollpane, I take each line ( which may have a different font and size etc. ) and calculate its height. The sum of all heights is the size of my scrollpane.. which is a perfect fit on 1.3 but is too small in 1.4..
do you see any workaround??
Regds
Lupo
P.S. Wish you a very happy new year.
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Nathan!
Well, thanks very much for that tip mate!!
Now, I have the height working properly. Since the code has to run in both 1.3 and 1.4 Jres, I calculated the height using the ascent, descent and leading. And now I have it correctly calculated.
Thanks again!!
Regds
Lupo
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic