Repository navigation
Introduction
This repository is a NetBeans project for comparing the text rendering of various builds of OpenJDK and FreeType. The project contains a simple Java Swing application called FontDemo that displays two text areas with the Source Code Pro font in TTF and OTF formats (the latest non-variable download). The goal of this repository was to report the severe color fringes in text rendered by OpenJDK on Ubuntu, and the problem is now tracked in the JDK Bug System by JDK-8212071.
I built four editions of the JDK from the latest OpenJDK sources. I built one that uses the system FreeType library and another that uses the bundled FreeType library. I then changed the OpenJDK code to set the default LCD filter and built the two editions again.
| OpenJDK | lcdnone | lcddefault |
|---|---|---|
| system | jdk-12-system-lcdnone | jdk-12-system-lcddefault |
| bundled | jdk-12-bundled-lcdnone | jdk-12-bundled-lcddefault |
I built 14 editions of the FreeType library. I built each of the following FreeType versions with the ClearType methods disabled (the library default). I then defined the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING and built them again with the ClearType methods enabled.
| Year | FreeType | Library | Included With |
|---|---|---|---|
| 2008 | 2.3.5 | 6.3.16 | Ubuntu 8.04 LTS |
| 2010 | 2.3.11 | 6.3.22 | Ubuntu 10.04 LTS |
| 2012 | 2.4.8 | 6.8.0 | Ubuntu 12.04 LTS |
| 2014 | 2.5.2 | 6.11.1 | Ubuntu 14.04 LTS |
| 2016 | 2.6.1 | 6.12.1 | Ubuntu 16.04 LTS |
| 2018 | 2.8.1 | 6.15.0 | Ubuntu 18.04 LTS |
| 2019 | 2.9.1 | 6.16.1 | OpenJDK 12 |
I automated the tests with the Bash script fontdemo.sh. The script loops over the builds of OpenJDK that use the system library and assumes they are installed in $HOME/opt. The FreeType libraries are expected to be found under $HOME/lib/amd64/default or $HOME/lib/amd64/enabled, depending on whether the ClearType methods are disabled (the default) or enabled. The script runs the Java Swing application 28 times covering seven FreeType versions, built with and without the ClearType methods enabled, and two OpenJDK builds, with and without setting the LCD filter.
The FontDemo application is built with NetBeans 9 running under OpenJDK 11.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Fonts by Adobe Systems, 2012, licensed under the SIL Open Font License Version 1.1. Prose by Mary Shelley, 1818, in the public domain. (Read on and contribute!)