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
- A simple banner applet produces
the above banner.
- You can do some neat effects
with the text once you load a font.
- You can learn Cyrillic, Hebrew, Thai, IPA,
Farsi, or Japanese.
- You can use this font package to display foreign text, for example in
Russian,
Japanese,
Hebrew,
Vietnamese,
or Thai, without requiring the user
to have the fonts installed locally.
- The PCFFont usage page describes
how to install and use the PCFFont class.
Below is another demonstration program, with
source. Select the font, foreground color,
and background color, and type some text to be displayed.
Obtaining fonts
Several people have been kind enough to give me permission to use their
fonts to demonstrate PCFFont.
- The fonts elder futhark and linear-b are ancient alphabet fonts created by
Curtis Clark,
Copyright 1992-1995, free for personal use.
- A.J. Palmer
supplied bookworm, casual tossed, goofball, roughage, and wacko. These are distributed as "guiltware".
- George Williams
supplied ambrosia, baldur, cupola. Copyright 1987-1994 George Williams.
- Astigmatic One Eye Font
Foundry supplied scrawn, rocky, and kittyprint.
Fonts created by Astigmatic One Eye Font Foundry Copyright 1997, All Rights
Reserved.
- Acidic is from Surfacetype
and is freeware.
Other fonts are public domain or freely usable subject to various conditions:
- Yellow dog, Concrete, and Fontocide are by Berry Brooks of
Fontocide.
- Granbrook, churchman, starcross, jeff-chris, and inkpad are from Graphics Arts Us.
- The Cyrillic fonts are part of the
X11 distribution fonts, Copyright 1994-1995 Cronyx Ltd.
- The Kanji font is part of the
X11 distribution fonts. It is donated to the public domain
by H. Kagotani.
- The Thai font was created by Manop Wongsaisuwan and is in the public
domain.
- The Hebrew font is part of the
X11 distribution fonts. It is Copyright 1991 Joseph Friedman.
- The New Century Schoolbook font is part of the
X11 distribution fonts. It is Copyright 1984-1989, 1994 Adobe
Systems Incorporated and Copyright 1988, 1994 Digital Equipment Corporation,
and has this
permission notice.
- The Inuit font is from K. Srinivasan; see the attached file.
- The Cherokee font is from Joan Sarah Touzet; see the attached file.
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:
[email protected]
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.