Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with attributed string drawing



This is a bug thats been around for years, but with the release of jdk 1.5.0 a new bug has been added. The original problem related to the TextLayout.getBounds() call returning an incorrect bounding box. But now not only are the bounding boxes incorrect, the string is also drawn incorrectly for arbitrary angles. I've included the code for a simple example demonstrating the problem and images running this example on Windows 2000 and jdk1.5, Mac OSX running 1.4.2 and 1.5.0.

The blue box is the getPixelBounds and the red box the TextLayout.getBounds(). The PixelBounds are suppose to be correct to the nearest pixel, the other is approximate. You'll notice that the two boxes are not identical using the Sun VM, but are very close. On Mac OSX and jdk 1.5.0 the two boxes are identical and both wrong! On 1.4.2, they are both wrong, but in different ways.

Donald Denbo

Attachment: DrawPanel.java
Description: Binary data

TIFF image

TIFF image

TIFF image

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.