Wednesday, December 31, 2008

Java 2D incompatibility between Sun JDK and OpenJDK

The Java 2D font renderer component was replaced when Sun JDK was open-sourced as OpenJDK with an open source version. But it appeared to have some bug. It's was about the vertical position gap in rendered fonts. I reported this bug on the OpenJDK mailing list and got a bug at:

http://bugs.sun.com/view_bug.do?bug_id=6761856

The results from the test (included in the bug page):

Sun JDK: x=5.78125,y=-47.796875,w=633.71484,h=57.515625
OpenJDK: x=5.78125,y=0.0,w=637.21875,h=96.34375

As you can see, the vertical positions are significantly off.

A fix was provided in OpenJDK7 by Sun folks:

http://hg.openjdk.java.net/jdk7/2d/jdk/rev/9cdababf6179


Thanks to Phil Race and Igor Nekrestyanov.

No comments: