Java Reference
In-Depth Information
Figure 13-5.
TextCanvas in the flesh
Selecting a Font
MIDP fonts are represented by a
font face
,
style
, and
size
. You won't find a big selection of
fonts, but there are a few choices. Three faces are available, as shown in Figure 13-6. These are
represented by constants in the
Font
class:
FACE_SYSTEM
,
FACE_MONOSPACE
, and
FACE_PROPORTIONAL
.
Figure 13-6.
The three font faces in italics
Once you've chosen a font face, you can also specify a style and a size. The styles are what
you'd expect, and they are represented by constants in the
Font
class:
STYLE_PLAIN
,
STYLE_BOLD
,
STYLE_ITALIC
, and
STYLE_UNDERLINE
. You can combine styles, like bold and italic, by ORing the
constants together. The size is simply
SIZE_SMALL
,
SIZE_MEDIUM
, or
SIZE_LARGE
.
Search WWH ::
Custom Search