Using Fonts with OpenJDK / Zulu

Zulu and OpenJDK installation packages do not include any font files by default. But both automatically use available fonts provided by the Operating System as high quality TTF files.

On headless servers or small Linux installations like containers or embedded systems those operating system font packages are usually not installed by default. Here the commands to install them:

RHEL / Centos:

sudo yum install fontconfig dejavu-sans-fonts dejavu-serif-fonts

Ubuntu / Debian:

sudo apt install fonts-dejavu fontconfig 

SLES:

sudo zypper install dejavu-fonts fontconfig

Desktop Operating Systems like Windows and macOS usually already have many fonts in TTF format already installed by default and don't require additional installations.

After installation of those font packages, Zulu will automatically use the TTF files provided by the packages. If an application asks for specific font names, like for example Lucida, the fontconfig package installed with the commands above provides a similar replacement font without the need for a change in the application code.

Here an example error message indicating that the installation commands listed above are needed:

Exception in thread "main" java.lang.Error: Probable fatal error:No fonts found.
at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236)
at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1100)

An alternative or addition to using the Operating System Fonts is the separate Zulu Commercial Compatibility Kit for Zulu version 6 - 8 which contains Lucida font files. Please refer for download and its terms of use on the following page: https://www.azul.com/products/zulu-and-zulu-enterprise/cck-downloads/

 If you don't see such an error message but the font rendering appears to be low quality, please also follow the instructions listed above as some TTF files might be missing on the system. If after the installation the font rendering appears to be still unexpected, take a look at Font rendering changes after upgrading Zulu.

Add Comment

Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful