|
|
|
The set of supported fonts varies between different implementations of the Java 2 platform. This page documents font support in Sun's Java 2 Software Development Kit, Standard Edition, v. 1.4 (J2SDK), and Java 2 Runtime Environment, Standard Edition, v. 1.4 (J2RE)
The Java 2 platform distinguishes between two kinds of fonts: physical fonts and logical fonts.
Physical fonts are the actual font libraries containing
glyph data and tables to map from character sequences to glyph
sequences, using a font technology such as TrueType or PostScript
Type 1. All implementations of the Java 2 platform must support
TrueType fonts; support for other font technologies is implementation
dependent. Physical fonts may use names such as Helvetica, Palatino,
HonMincho, or any number of other font names. Typically, each
physical font supports only a limited set of writing systems, for
example, only Latin characters or only Japanese and Basic Latin. The
set of available physical fonts varies between configurations.
Applications that require specific fonts can bundle them and
instantiate them using the
createFont
method.
Logical fonts are the five font families defined by the Java platform which must be supported by any Java runtime environment: Serif, SansSerif, Monospaced, Dialog, and DialogInput. These logical fonts are not actual font libraries. Instead, the logical font names are mapped to physical fonts by the Java runtime environment. The mapping is implementation and usually locale dependent, so the look and the metrics provided by them vary. Typically, each logical font name maps to several physical fonts in order to cover a large range of characters.
Peered AWT components, such as
Label
and
TextField
,
can only use logical fonts.
For a discussion of the relative advantages and disadvantages of using physical or logical fonts, see the Internationalization FAQ document.
Sun's Java 2 Runtime Environment supports TrueType and PostScript Type 1 fonts.
Physical fonts need to be installed in locations known to the Java
runtime environment. Sun's Java 2 Runtime Environments look in two
locations: the lib/fonts
directory within the J2RE
itself, and the normal font location(s) defined by the host operating
system. If fonts with the same name exist in both locations, the one
in the lib/fonts
directory is used.
Users can add physical fonts that use a supported font technology
by installing them either in the lib/fonts
directory
within the J2RE, or by installing them in a way supported by the host
operating system (dropping them into the Fonts folder on Windows,
using the pkgadd command on Solaris).
Logical font names are mapped to physical fonts in implementation dependent ways. Typically one logical font name maps to several physical fonts in order to cover a large range of characters. Sun's Java 2 Runtime Environments use font.properties files to define the mapping.
Adventurous users can modify the font.properties files or create new ones. For example, users may want to add additional physical fonts to a given mapping in order to extend the set of characters supported by a logical font.
Sun's Java 2 Software Development Kit and Java 2 Runtime Environments bundles several physical fonts of the "Lucida" design family. These fonts are also licensed for use in other implementations of the Java 2 platform. These fonts are physical fonts, but since they come with the Java 2 runtime, they don't depend on the host operating system. Using them provides the benefit of a consistent look and feel across platforms and implementations for a large set of languages.
There are three different type families: "Lucida
Sans"
, "Lucida Sans Typewriter"
, and
"Lucida Bright"
. Each family has plain, bold, italic, and
bold-italic styles. Not all of these are present in all Java 2
implementations. For example, the default download bundle of Sun's
Java 2 Runtime Environment for Windows only contains the Lucida Sans
plain font (but note that application developers can include all
Lucida fonts with a J2RE that they
redistribute with
an application).
The following table shows which Unicode 3.0 character blocks are covered by each font family:
Unicode Block |
Lucida Sans |
Lucida Sans Typewriter |
Lucida Bright |
---|---|---|---|
Basic Latin |
yes |
yes |
yes |
Latin-1 Supplement |
yes |
yes |
yes |
Latin Extended-A |
yes |
yes |
yes |
Latin Extended-B |
partial |
partial |
partial |
IPA Extensions |
partial |
no |
no |
Spacing Modifier Letter |
partial |
partial |
partial |
Combining Diacritical Marks |
partial |
no |
partial |
Greek |
yes |
yes |
yes |
Cyrillic |
partial |
partial |
partial |
Hebrew |
yes |
yes |
no |
Arabic |
partial |
partial |
partial |
Devanagari |
yes |
no |
no |
Thai |
yes |
yes |
no |
General Punctuation |
partial |
partial |
partial |
Superscripts and Subscripts |
partial |
partial |
partial |
Currency Symbols |
partial |
partial |
partial |
Letterlike Symbols |
partial |
partial |
partial |
Number Forms |
partial |
partial |
no |
Arrows |
partial |
partial |
partial |
Mathematical Operators |
yes |
partial |
yes |
Enclosed Alphanumerics |
partial |
no |
no |
Box Drawings |
partial |
partial |
no |
Block Elements |
partial |
partial |
no |
Geometric Shapes |
partial |
partial |
partial |
Miscellaneous Symbols |
partial |
partial |
no |
Dingbats |
yes |
no |
no |
Alphabetic Presentation Forms |
partial |
partial |
no |
Arabic Presentation Forms-A |
partial |
partial |
partial |
Arabic Presentation Forms-B |
yes |
yes |
yes |
Note that of the writing systems that are generally fully supported by Sun's Java 2 Runtime Environments, the Lucida fonts do not support Chinese (Simplified), Chinese (Traditional), Japanese, and Korean.
The fonts are installed in the Java 2 Runtime Environment's
lib/fonts
directory as the following files (not all of
them may be present):
LucidaSansDemiBold.ttf LucidaSansDemiOblique.ttf LucidaSansOblique.ttf LucidaSansRegular.ttf LucidaTypewriterBold.ttf LucidaTypewriterBoldOblique.ttf LucidaTypewriterOblique.ttf LucidaTypewriterRegular.ttf LucidaBrightDemiBold.ttf LucidaBrightDemiItalic.ttf LucidaBrightItalic.ttf LucidaBrightRegular.ttf
Copyright © 2000-2001 Sun Microsystems, Inc. All Rights Reserved. Please send comments to: java-intl@java.sun.com |
|