RendererOur Java™ font renderer uses two painting styles:
However on some VMs there is a performance penalty for the double-buffering this necessitates (though on some VMs this sort of painting appears to be faster).
Font sourcesIf run under Java 2, the renderer can access the same range of TrueType™ fonts available to all Java applications.
Under other versions of Java, it renders fonts from a proprietary format - a format which can be derived automatically from TrueType fonts while running under Java 2.
This allows a very compact distribution format to be used (compared to the original fonts) - which reduces download times.
One of the disadvantages of doing this is that some fonts are copyrighted - and are distributed under licenses that do not permit redistribution of modified versions.
Eventually we hope to write a parser to extract the relevant tables directly from TrueType font files - bypassing the code in Java 2 that is currently used to performs this task.
HintingGood hinting is one of the most critical aspects of rendering fonts.
Currently our hinting is still in a relatively primitive state - and there is a great deal of room for improvement.
Hinting philosophyCurrently we do all our hinting based on the font outlines.
All other potential sources of hinting information are currently ignored.
Eventually, we hope to be able to take advantage of the hinting information present in TrueType fonts.
However there is no guarantee that such hinting will be present - so the ability to render straight from font outlines will always be important.
LimitationsThere are some areas of the TrueType specification that we will probably not adhere to - at least not a considerable time.
In particular, a low-level graphics primitive that implements a non-zero winding fill rule is not available under many forms of Java. Before Java 2D, even/odd was the only winding rule available.
We may eventually write our own polygon-fill routine - but the distortions of the (few) fonts that rely on the details of the winding rule is likely to remain as a known problem for some time.
AcknowledgementsTrueType is a registered trademark of Apple Computer, Inc.
Java is a registered trademark of Sun Microsystems.
Sun Microsystems and Apple Computer are also a registered trademarks.