Java Fonts Unfortunately, you don't have the Java language, so you can't see it work.

Are you bored with the standard Java fonts? Do you wish you could use all sorts of exciting display fonts? Do you want people to read your text in 14 point Baskerville bold instead of the ugly font that their browser supplies? Do you want to display Russian or Thai without worrying about internationalized browsers and local fonts?

All these problems are solved with my new easy-to-use Java class that lets you use your favorite bitmap font. This class, called PCFFont, lets you display any PCF (X11 portable compiled format) bitmap font, and also provides antialiased rendering.

Example uses of new fonts

Below is another demonstration program, with source. Select the font, foreground color, and background color, and type some text to be displayed.
Unfortunately, you don't have the Java language, so you can't see it work.

Obtaining fonts

Several people have been kind enough to give me permission to use their fonts to demonstrate PCFFont. Other fonts are public domain or freely usable subject to various conditions: Where can you get other PCF format fonts? One source is the X11 distribution. If you have a Unix system, look in /usr/openwin/bin/fonts. Online, look in the Xfree86 distribution. If a font file ends in .bdf, you can convert it to pcf with bdftopcf. If a file ends in .pcf.Z, you need to uncompress it first.

Tons of interesting fonts are available in TrueType format; take a look at Yahoo. Unfortunately the PCFFont class can't interpret TrueType fonts (although someone is working on a Java TrueType interpeter!), but fortunately you can convert TrueType fonts to PCF format. To do this, you need freetype and ttf2bdf. You use ttf2bdf to convert the TrueType font to BDF and then use bdftopcf (which should exist on your Unix machine) to convert the font to PCF. This is how I got most of the fonts above.

Note: Fonts are generally subject to copyright and licensing agreements. Please follow the applicable licensing agreements.

For other ways to use bitmap fonts in Java, see Kevin Hughes's GraphicFont and Paul Haeberli's GifFont class, which is part of his WebFonts proposal.


WebCounter:
Ken Shirriff: shirriff@eng.sun.com
This page: http://www.righto.com/java/fonts/index.html
Copyright 1998 Ken Shirriff. Last updated 1/21/99. Java and other Java-based names are trademarks of Sun Microsystems, Inc. and refer to Sun's family of Java-branded technologies. Use of this software is subject to the terms of the license agreement.