
of a single glyph. You can also call getGlyphMetrics() to obtain a GlyphMetrics
object that contains detailed metrics for an individual glyph.
Two other methods,
setGlyphPosition() and setGlyphTransform(),are designed
to let you set the position and transform for individual glyphs. For example, you
might use
setGlyphPosition() to increase the interletter spacing of a glyph in a
GlyphVector in order to implement fill-justification. In the initial release of Java
1.2, however, these methods are not implemented. If you want to handle the low-
level layout of glyphs, one approach is to implement your own subclass of the
abstract
GlyphVector class.
A
GlyphVector object can repr esent only glyphs from a single font; the default
implementation repr esents only glyphs that appear on a single line of text. If you
want to repr esent a single line of multifont text, you can use a
java.awt.-
font.TextLayout object. And if you want to work with multiline text, you can use
java.awt.font.LineBreakMeasurer to break a paragraph of multifont text into
multiple
TextLayout objects, each repr esenting a single line of text.
TextLayout is a powerful class for displaying multifont text. It supports bidirec-
tional text layout, such as when left-to-right English text is mixed with right-to-left
Hebr ew or Arabic text or when right-to-left Hebrew letters are mixed with left-to-
right Hebrew numbers. Once you’ve created a
TextLayout ...