[OpenJDK 2D-Dev] Using OpenJDK's FreeType support in a standard Sun JRE

Igor Nekrestyanov Igor.Nekrestyanov at Sun.COM
Thu Apr 9 09:05:01 UTC 2009

Hello Daniel,

It is not possible to simply copy part of openjdk to your application in 
order to add support for plugging freetype.
It does require changes in the jdk libraries itself to support concept 
of pluggable rasterizers.

In theory it might be possible to use your own rasterizer (and your own 
API to convert text to image instead of drawString(), etc.)
but this does not sound like the reasonable approach.

In terms of public API there were no changes related to support of 
freetype in the JDK. Therefore, if you will stick to standard API
then service quality will degrade gradually. Users will be able to 
benefit from JDK7 improvements and freetype support in the 
openjdk6/openjdk7 if they install them.  On other hand application will 
still work (but support less fonts) on any other JDK.


Daniel Dreibrodt wrote:
> Hello.
> I'm working on the VLC Skin Editor project which provides a WYSIWYG
> editor for skin files for the VLC media player. As a part of the preview
> rendering I have to draw text in custom fonts on a Graphics2D context.
> So far I use the standard java.awt.font mechanisms to do so.
> But until JRE 6 java.awt.font still does not support all OpenType fonts.
> This will be fixed in JRE 7 I know, but also in antialiasing etc. the
> java.awt.font system has of course differences to the way VLC displays
> them, as it uses libfreetype.
> So I found that in OpenJDK there is an interface to libfreetype which
> sounds perfectly fit for my problem. But I want to leave the program
> compatible with standard Sun JREs. So my question is what I would have
> to do, which classes to copy etc. , to integrate FreeType support from
> OpenJDK into my Java application.
> Your help is very much appreciated,
> Daniel Dreibrodt

More information about the 2d-dev mailing list