Oracle JDK vs. OpenJDK: font engine differences

Volker Simonis volker.simonis at gmail.com
Tue Nov 14 15:06:02 UTC 2017


Hi Dalibor,

the Oracle JDK 9 (downloaded from [1]) still contains the T2K font
renderer (at least on Linux and Windows):

$ ./jdk-9.0.1/bin/java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

$ grep -ri T2KFontScaler jdk-9.0.1/
Binary file jdk-9.0.1/lib/libt2k.so matches
Binary file jdk-9.0.1/lib/modules matches
Binary file jdk-9.0.1/jmods/java.desktop.jmod matches

The reference implementation (both versions, the GPL licensed one as
well as the Oracle Binary Code licensed one, downloaded from [2])
definitely don't contain the T2K renderer:

$ ./java-se-9-ri-obcl/jdk-9/bin/java -version
openjdk version "9"
OpenJDK Runtime Environment (build 9+181)
OpenJDK 64-Bit Server VM (build 9+181, mixed mode)

$ grep -ri T2KFontScaler ./java-se-9-ri-obcl
Binary file ./java-se-9-ri-obcl/jdk-9/lib/modules matches

The corresponding switch for enabling T2K for non-OpenJDK builds is
still in the jdk10 [3] code base:

Class<? extends FontScaler> tmp = (Class<? extends FontScaler>)
    (FontUtilities.isOpenJDK ?
     Class.forName("sun.font.FreetypeFontScaler") :
     Class.forName("sun.font.T2KFontScaler"));

If you're aware of a JBS issue to remove it please post it here.

Another issue which many users of the current Oracle JDK are not aware
of is that the Oracle JDK contains a set of standard fonts which many
applications more or less "depend" on:

$ la jdk-9.0.1/lib/fonts/
total 2052
-rw-r--r--  1 simonis simonis   4041 Sep 28 05:51 fonts.dir
-rw-r--r--  1 simonis simonis  75144 Sep 28 05:51 LucidaBrightDemiBold.ttf
-rw-r--r--  1 simonis simonis  75124 Sep 28 05:51 LucidaBrightDemiItalic.ttf
-rw-r--r--  1 simonis simonis  80856 Sep 28 05:51 LucidaBrightItalic.ttf
-rw-r--r--  1 simonis simonis 344908 Sep 28 05:51 LucidaBrightRegular.ttf
-rw-r--r--  1 simonis simonis 317896 Sep 28 05:51 LucidaSansDemiBold.ttf
-rw-r--r--  1 simonis simonis 698236 Sep 28 05:51 LucidaSansRegular.ttf
-rw-r--r--  1 simonis simonis 234068 Sep 28 05:51 LucidaTypewriterBold.ttf
-rw-r--r--  1 simonis simonis 242700 Sep 28 05:51 LucidaTypewriterRegular.ttf

The OpenJDK binaries don't contain these fonts:

$ la ./java-se-9-ri-obcl/jdk-9/lib/fonts
ls: cannot access './java-se-9-ri-obcl/jdk-9/lib/fonts': No such file
or directory

This can be especially problematic on Linux where each distribution
has its own, potentially different set of standard fonts.

Are there any plans to open-source the aforementioned fonts such that
they can be added to the OpenJDK and be distributed along with it? Or
is it clear that the fonts currently shipped with the Oracle JDK will
never be included into the OpenJDK (e.g. because of licensing issues)?

Regards,
Volker

[1] http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html
[2] http://jdk.java.net/java-se-ri/9
[3] http://hg.openjdk.java.net/jdk/jdk/file/94f362b5f4dd/src/java.desktop/share/classes/sun/font/FontScaler.java

On Tue, Nov 14, 2017 at 2:08 PM, dalibor topic <dalibor.topic at oracle.com> wrote:
>
>
> On 14.11.2017 13:56, Mario Torre wrote:
>
>>> As https://bugs.openjdk.java.net/browse/JDK-8093768 shows, freetype
>>> has
>>> already been the default in Oracle JDK builds for embedded and
>>> desktop
>>> Linux & OS X for a couple of years.
>>
>>
>> This is also JavaFX, or am I misreading the bug report and target
>> components?
>
>
> You're right, of course - sorry for the confusion.
>
>
> cheers,
> dalibor topic
>
> --
> <http://www.oracle.com> Dalibor Topic | Principal Product Manager
> Phone: +494089091214 <tel:+494089091214> | Mobile: +491737185961
> <tel:+491737185961>
>
> ORACLE Deutschland B.V. & Co. KG | Kühnehöfe 5 | 22761 Hamburg
>
> ORACLE Deutschland B.V. & Co. KG
> Hauptverwaltung: Riesstr. 25, D-80992 München
> Registergericht: Amtsgericht München, HRA 95603
>
> Komplementärin: ORACLE Deutschland Verwaltung B.V.
> Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
> Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
> Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
>
> <http://www.oracle.com/commitment> Oracle is committed to developing
> practices and products that help protect the environment


More information about the discuss mailing list