Oracle JDK vs. OpenJDK: font engine differences

Volker Simonis volker.simonis at gmail.com
Tue Nov 14 17:18:58 UTC 2017


Hi Phil,

thanks for the clarifications.

On Tue, Nov 14, 2017 at 5:52 PM, Phil Race <philip.race at oracle.com> wrote:
> Hi Volker,
>
> I don't think there is a claim anywhere  that JDK 10 EA "Oracle JDK"
> binaries have
> already migrated to be GPL binaries.
>

I didn't asserted that there is such a claim. I just noticed that T2K
is still used in Oracle's JDK 10 binaries today and that I've seen no
discussion about removing it yet, because that was not clear from the
first answers on this thread.

> The migration from T2K to Freetype still has to take place and I expect
> there
> will be occasional rendering and measurement differences which will be
> considered incompatibilities but it is inevitable and unavoidable.
>
> It should be mitigated by the facts that Linux distros already use freetype
> in their binaries so it should be no difference there, and on Mac. we mostly
> use the Mac native coretext renderer, and on Windows we get LCD glyphs
> (what most UIs use) from GDI as well.
> Still there are plenty of cases where T2K is used for glyphs + metrics.
>

I know a lot of people who have switched back from OpenJDK to Oracle
JDK "because the fonts looked better". But thats mostly because of
Oracle JDK's integrated fonts, not because of the renderer. And that
may have changed with better font properties files and fonts in recent
Linux distributions.

> As to the Lucida fonts, like T2K, if we could have open sourced those we
> would have done it in 2007 at the inception of OpenJDK. Whilst the license
> was generous it was not that generous ..
>

That's a pity but we can not change that. Maybe it would be worth
while thinking about the inclusion of an open-source, high-quality,
Unicode-complete (well as much as possible :) font family into the
OpenJDK, such that we can get precise, cross-platform font rendering ?
I'm not a font expert, but it seems that there are quite some free
fonts available nowadays (e.g. Google Fonts, Ubuntu fonts) and maybe
we can even convince IBM to donate their WorldType font family now
that they've open sourced J9 :)

> I am sure that many apps - and many internal behaviours - were written
> with an assumption they were there and we will definitely have to accept
> that there will be consequences both in terms of changes we need to make
> to internal JDK code and changes apps will need to make to adapt.
> Those that have been tested on OpenJDK should have made those adaptations
> long ago ..
>
> Also although those are some of the most prominent pieces we can't open
> source,
> there are other more obscure ones. For example the ICC profile files in
> Oracle JDK
> were licensed from Kodak and can't be open sourced. We'll need to switch
> those
> to the open source ones, with minor consequences but only to the most colour
> sensitive sophisticated apps ..
>

Yes, I know but I agree that color profiles won't impact nearly as
many people as different font layout.

Regards,
Volker

> -phil
>
>
> On 11/14/2017 07:06 AM, Volker Simonis wrote:
>>
>> 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