adoptium / temurin-build

Eclipse Temurin™ build scripts - common across all releases/versions
Apache License 2.0
1.02k stars 247 forks source link

OpenJDK 8 broken font rendering e.g. for Google font "Great Vibes" #1337

Closed BuZZ-dEE closed 4 years ago

BuZZ-dEE commented 4 years ago

Platform: Debian GNU/Linux 9.9 (stretch), Ubuntu 18.04, Arch Linux

Architecture: amd64

Please see the following images for Google font "Great Vibes":

OpenJDK 8 broken font redering:

openjdk-8-font-incorrect

openjdk-8-font-incorrect-marked

OracleJDK 8, OpenJDK 10, 11, 13 correct font rendering:

openjdk-13-font-correct

Example code:

Wrong rendering not visible:

javax.swing.JButton button = new javax.swing.JButton("Open");
java.awt.Font font = new java.awt.Font("Great Vibes", Font.PLAIN, 64);
button.setFont(font);

OpenJDK-8-font-size-128-wrong-rendering-not-visible png

Wrong rendering visible:

javax.swing.JButton button = new javax.swing.JButton("Open");
java.awt.Font font = new java.awt.Font("Great Vibes", Font.PLAIN, 128);
button.setFont(font);

OpenJDK-8-font-size-128-wrong-rendering-visible

BuZZ-dEE commented 4 years ago

As it turns out, it is related to the font version we are using.

broken font version: openjdk-8-25 222-b05_rendering_incorrect_great-vibes

correct font version downloaded from here openjdk-8-1 8 0_222-b05_rendering_correct_great-vibes

BuZZ-dEE commented 4 years ago

https://github.com/corretto/corretto-8/issues/176

BuZZ-dEE commented 4 years ago

@karianna why you closed this issue?

karianna commented 4 years ago

@BuZZ-dEE - I think I interpreted your previous message incorrectly! I thought you fixed it by a 3rd party upgrade of a font library.

gdams commented 4 years ago

This is to do with the fact that we don't ship Marlin renderer in jdk8 (Azul and Oracle do) This is expected behaviour and is not a bug. There are already multiple issues in this repo about this. Please follow https://github.com/AdoptOpenJDK/openjdk-build/issues/1119 for updates. Closing

BuZZ-dEE commented 4 years ago

@gdams Are you sure, that this problem has to do with Marlin renderer? I tried to use Marlin-renderer 0.9.4.2:

java -Xbootclasspath/a:${PATH_TO_MARLIN}/marlin-X.Y.Z-Unsafe.jar \
     -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine \
     ...

and the problem still exists:

FontRederingErrorDemo.zip

If I understand you correct, the above should fix the broken font rendering?

BuZZ-dEE commented 4 years ago

Backport of 8057986: freetype code to get glyph outline does not handle initial control point properly https://github.com/corretto/corretto-8/pull/183

https://bugs.openjdk.java.net/browse/JDK-8057986

BuZZ-dEE commented 4 years ago

fixed in jdk8u242-b08

thank you