9/08/2014

Fix Java font smoothing on FreeBSD: re-building the port tree's OpenJDK from sources with Infinality patches

The current OpenJDK available in FreeBSD's port tree lacks some eye-candy regarding font-rendering capabilities. Since Freetype2 already includes subpixel-rendering support, we just have to patch the JDK. So first we make an "extract patch" (e.g. no compile, only acquiring sources, applying official FreeBSD patches), then we'll patch with the Infinality patches available in the git repo below.

OpenJDK7

cd /usr/ports/java/openjdk7
sudo make extract patch
cd ~
git clone https://gist.github.com/2893461.git
sudo mv 2893461/fontfix.patch /usr/ports/java/openjdk7/work/openjdk/jdk/
cd /usr/ports/java/openjdk7/work/openjdk/jdk/
sudo patch -p1 < fontfix.patch
cd /usr/ports/java/openjdk7/
sudo make install clean

OpenJDK6

cd /usr/ports/java/openjdk6
sudo make extract patch
cd ~
rm -rf 2893461
git clone https://gist.github.com/2893461.git
sudo mv 2893461/fontfix.patch /usr/ports/java/openjdk6/work/jdk/
cd /usr/ports/java/openjdk6/work/jdk/
sudo patch -p1 < fontfix.patch
cd /usr/ports/java/openjdk6/
sudo make install clean
If you already have openjdk7 installed, you'll need to reinstall instead. In this case replace the last line with
sudo make deinstall reinstall clean

No comments:

Post a Comment