Fonts and Internationalization in Java

I'm interested in writing multilingual apps in Java- and that often means loading wierd fonts. This page is where I collect information about Java and fonts.

HTML Internationalization Links

JDK 1.0.2 Font and Internationalization Links

JDK 1.1 Font Links

JDK 1.1 Internationalization Links

JDK 1.2 Font and Internationalization Links

Miscelaneous Font Links

Miscelaneous Internationalization Links

My opinions

Font.properties is evil - Will JDK 1.2 still require it?

[I suspect JDK 1.2 will not require users to edit the font.properties file, at least to get basic access to system fonts, but I don't know if e.g. Win95 fonts for arbitrary parts of the Unicode codepoint space will map correctly into Java's Unicode codepoint space yet. Since JDK 1.2 beta 3 is out, this should be easily testable by anyone who has such a font. What follows is an explanation of the JDK 1.1 situation. - drk]

Sun's JDK uses the 'font.properties' file to support Unicode on the current crop of non-Unicode operating systems.

Problem is, it's far too complicated for end-users. Sun: how do end users install Unicode fonts without waving rubber chickens around their heads? Editing the font.properties file is *way beyond* the skills of my Mom and many other end-users!

If Sun really means us to use font.properties to deply applications, they should provide ways to manage that file reliably. So far they seem to be ignoring the issue.

Recently, in the Java2d-Interest mailing list, I asked Sun to ...

provide example sources for a multilingual plain text editor
written in Java. Since many of the issues in multilingual
support are practical rather than theoretical, it would
be very useful if the example included everything-
self-extracting installer, fonts, etc.- needed to drop
on somebody's desktop and run.
Jeet replied:
>What I can tell you right now, is that a multilingual text control is high on 
>our priority list and there are people addressing this issue. I would like to 
>get into more detail about i18n issues, perhaps at a later date. 

It's good to hear that a multilingual text control is being worked on. But my question also covered the practical matter of installing fonts, which is beyond what people usually mean when they talk about i18n.

Others have asked similar questions. For example, Glen Perkins asked:

>Subject: Multilingual support
>From: Glen Perkins (glen.perkins@nativeguide.com)
>Date: Tue, 18 Mar 1997 10:41:37 -0800 
>... For a system using the Java2D classes, what would I instruct an American
>user in my installation instructions (standalone app), and what would I
>write into my source code, so that I could display Japanese text on his
>machine? ...
The only reply to Glen's question from Sun was from Jeet:
> The intention of the Java2D API is to use the host fonts "face name" as the 
> identifier for fonts. The direction would be to getFonts() and then use them as 
> needed.
It's not clear to me how this solves the question of mapping Unicode chars to host fonts. (I'm a font newbie; maybe someone can explain it.)

The developers of Babble (a helper application for Web browsers that lets them display Unicode text; itself written in Java, and run under JRE 1.1.3) were faced with this same problem. Their "Downloading & Installing Fonts" page answers Glen's question, at least for Windows95/NT. Here's its gist:

  1. [Download the font(s) of interest. Links to a few are provided.]
  2. Use a utility such as WinZip or PKunzip to decompress the zip file(s), then open the fonts control panel, pull down "file" and choose "install new font" and select the temporary directory and font file to install. After installation, you can delete the temporary copy. You may also be able to install the fonts by simply copying them from the temporary directory to c:\windows\fonts; Cyberbit has installation instructions in doc.zip which you may wish to consult as well. NOTE: Each of the Cyberbit zip files unzip to the same file name, CYBERBIT.TTF. If you need more than one Cyberbit font file, unzip them into different directories.
  3. Finally, you will want to modify your font.properties file in java/lib so that Java applications can make use of the Cyberbit font, once you've installed it. There is information on how to make those modifications in the online documentation for Babble. If you have problems, please consult the Cyberbit documentation, our online documentation and/or the email archives for babble-l before mailing babble-l for advice.
OK. Quick quiz: how many of you actually read all that? Right. Most users won't, either. In fact, they will quickly give up trying to run such an application. Maybe an installer program could automate this process, but Sun has yet to give us example sources for such an installer, let alone show us how to invoke such an installer from an applet.

And what about users who delete font.properties- that would screw everything up. Why should I worry about that? Well, read Marimba's Tuner FAQ:

>Q. My channels look odd when published under JDK 1.02 and viewed with the JDK 1.1 Tuner.
>A. This is solved by removing the font.properties from the jdk1.1.2\lib\ directory. 
Or read Sun's own JavaCC install help:
>There is a bug in JDK 1.1 that causes the installation to terminate in some situations
>... the workaround [is]:
> Remove (delete or move somewhere else) the file "lib/font.properties" from the
> JDK 1.1 release directory. This will be located at the same place where the
> "bin" directory containing "java", "javac", etc. are located.  ...
> We recommend you do this since this will be
> necessary to solve similar problems with your other Java tools.  
That's right: Sun themselves tell end-users to *delete the font.properties file*, wiping out any changes made while installing fonts. I submit to you, gentle programmers, that the font.properties file is as harmful as the goto statement!

Java2D is supposed to improve the font situation. Does it address the question of installing fonts, or the fagility of the font.properties file? The Java2D FAQ says: "Java 2D offers comprehensive text and font handling. It can utilize *platform fonts* that are available in either True Type or Type 1 formats."

It sounds like the answer is "no, Java2D will not address the issue of installing fonts; the user will still have to download and install fonts in a platform-dependent way, not under the control of the Java program." Install programs will be very system-dependent, and won't be 100% Pure. Surely Sun can't be happy with this state of affairs.

Web browsers are addressing this issue, albeit in a way that can't be used by Java (because the downloaded "embedded" fonts are crippled to prevent them from being used to create new documents). When will Java?

In particular,

  1. When will the JDK come with example sources that show how to automatically install platform fonts, and an example Java application *with installer* that demonstrates how to deliver a shrinkwrapped Java application that comes with its own fonts?
  2. When will the JDK support fonts that don't need to be installed on the user's platform, but which are instead part of the Java application / applet?