GlyphVector object is a collection of glyphs
containing geometric information for the placement of each glyph
in a transformed coordinate space which corresponds to the
device on which the GlyphVector is ultimately
displayed.
The GlyphVector does not attempt any interpretation of
the sequence of glyphs it contains. Relationships between adjacent
glyphs in sequence are solely used to determine the placement of
the glyphs in the visual coordinate space.
Instances of GlyphVector are created by a Font.
In a text processing application that can cache intermediate
representations of text, creation and subsequent caching of a
GlyphVector for use during rendering is the fastest
method to present the visual representation of characters to a user.
A GlyphVector is associated with exactly one
Font, and can provide data useful only in relation to
this Font. In addition, metrics obtained from a
GlyphVector are not generally geometrically scalable
since the pixelization and spacing are dependent on grid-fitting
algorithms within a Font. To facilitate accurate
measurement of a GlyphVector and its component
glyphs, you must specify a scaling transform, anti-alias mode, and
fractional metrics mode when creating the GlyphVector.
These characteristics can be derived from the destination device.
For each glyph in the GlyphVector, you can obtain:
GlyphVector. The metrics of the glyph may be
different under different transforms, application specified
rendering hints, and the specific instance of the glyph within
the GlyphVector.
Altering the data used to create the GlyphVector does not
alter the state of the GlyphVector.
Methods are provided to adjust the positions of the glyphs
within the GlyphVector. These methods are most
appropriate for applications that are performing justification
operations for the presentation of the glyphs.
Methods are provided to transform individual glyphs within the
GlyphVector. These methods are primarily useful for
special effects.
Methods are provided to return both the visual, logical, and pixel bounds
of the entire GlyphVector or of individual glyphs within
the GlyphVector.
Methods are provided to return a Shape for the
GlyphVector, and for individual glyphs within the
GlyphVector.
Font, GlyphMetrics, TextLayout
| Modifier and Type | Field and Description |
|---|---|
| public static final int | FLAG_COMPLEX_GLYPHS
A flag used with getLayoutFlags that indicates that this |
| public static final int | FLAG_HAS_POSITION_ADJUSTMENTS
A flag used with getLayoutFlags that indicates that this |
| public static final int | FLAG_HAS_TRANSFORMS
A flag used with getLayoutFlags that indicates that this |
| public static final int | FLAG_MASK
A mask for supported flags from getLayoutFlags. |
| public static final int | FLAG_RUN_RTL
A flag used with getLayoutFlags that indicates that this |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: true if the specified
GlyphVector equals this GlyphVector;
false otherwise.the specified set)GlyphVector to testTests if the specified |
| public abstract Font | Returns: Font used to create this
GlyphVector.Returns the |
| public abstract FontRenderContext | Returns: FontRenderContext used to create this
GlyphVector.Returns the |
| public int | Returns: the index of the first character represented by the glyphthe index of the glyph glyphIndex)Returns the character index of the specified glyph. |
| public int[] | Returns: an array of character indices, one per glyph.the index of the first glyph beginGlyphIndex, int the number of glyph indices numEntries, int[] the array into which to return the character indices codeReturn)Returns the character indices of the specified glyphs. |
| public abstract int | Returns: the glyphcode of the glyph at the specifiedglyphIndex.the index into this glyphIndex)GlyphVector
that corresponds to the glyph from which to retrieve the
glyphcode.Returns the glyphcode of the specified glyph. |
| public abstract int[] | Returns: an array of glyphcodes for the specified glyphs.the index into this
beginGlyphIndex, int GlyphVector at which to start retrieving glyphcodesthe number of glyphcodes to retrieve numEntries, int[] the array that receives the glyphcodes and is
then returned codeReturn)Returns an array of glyphcodes for the specified glyphs. |
| public abstract GlyphJustificationInfo | Returns: aGlyphJustificationInfo object that
represents the justification properties of the glyph at the
specified glyphIndex into this
GlyphVector.the index into this glyphIndex)GlyphVector
that corresponds to the glyph from which to retrieve its
justification propertiesReturns the justification information for the glyph at
the specified index into this |
| public abstract Shape | Returns: aShape that is the logical bounds of the
glyph at the specified glyphIndex.the index into this glyphIndex)GlyphVector
that corresponds to the glyph from which to retrieve its logical
boundsReturns the logical bounds of the specified glyph within this
|
| public abstract GlyphMetrics | Returns: aGlyphMetrics object that represents the
metrics of the glyph at the specified glyphIndex
into this GlyphVector.the index into this glyphIndex)GlyphVector
that corresponds to the glyph from which to retrieve its metricsReturns the metrics of the glyph at the specified index into
this |
| public abstract Shape | Returns: aShape that is the outline of the glyph
at the specified glyphIndex of this
GlyphVector.the index into this glyphIndex)GlyphVectorReturns a |
| public Shape | Returns: aShape that is the outline of the glyph
at the specified glyphIndex of this
GlyphVector when rendered at the specified
coordinates.the index into this glyphIndex, float GlyphVectorthe X coordinate of the location of this x, float GlyphVectorthe Y coordinate of the location of this y)GlyphVectorReturns a |
| public Rectangle | Returns: aRectangle bounding the pixels that would be affected.the index of the glyph. index, FontRenderContext the renderFRC, float FontRenderContext of the Graphics.the X position at which to render this x, float GlyphVector.the Y position at which to render this y)GlyphVector.Returns the pixel bounds of the glyph at index when this
|
| public abstract Point2D | getGlyphPosition(int
the index into this glyphIndex)GlyphVectorReturns the position of the specified glyph relative to the
origin of this |
| public abstract float[] | Returns: an array of glyph positions specified bybeginGlyphIndex and numEntries.the index at which to begin retrieving
glyph positions beginGlyphIndex, int the number of glyphs to retrieve numEntries, float[] the array that receives the glyph positions
and is then returned. positionReturn)Returns an array of glyph positions for the specified glyphs. |
| public abstract AffineTransform | getGlyphTransform(int
the index into this glyphIndex)GlyphVectorReturns the transform of the specified glyph within this
|
| public abstract Shape | Returns: aShape that is the visual bounds of the
glyph at the specified glyphIndex.the index into this glyphIndex)GlyphVector
that corresponds to the glyph from which to retrieve its visual
boundsReturns the visual bounds of the specified glyph within the
|
| public int | Returns: an int containing the flags describing the stateReturns flags describing the global state of the GlyphVector. |
| public abstract Rectangle2D | |
| public abstract int | Returns: number of glyphs in thisGlyphVector.Returns the number of glyphs in this |
| public abstract Shape | Returns: aShape that is the outline of this
GlyphVector.Returns a |
| public abstract Shape | Returns: aShape that is the outline of this
GlyphVector when rendered at the specified
coordinates.the X coordinate of this x, float GlyphVector.the Y coordinate of this y)GlyphVector.Returns a |
| public Rectangle | Returns: aRectangle bounding the pixels that would be affected.the renderFRC, float FontRenderContext of the Graphics.the x-coordinate at which to render this x, float GlyphVector.the y-coordinate at which to render this y)GlyphVector.Returns the pixel bounds of this |
| public abstract Rectangle2D | Returns: aRectangle2D that is the bounding box
of this GlyphVector.Returns the visual bounds of this |
| public abstract void | |
| public abstract void | setGlyphPosition(int
the index into this glyphIndex, Point2D GlyphVectorthe newPos)Point2D at which to position the
glyph at the specified glyphIndexSets the position of the specified glyph within this
|
| public abstract void | setGlyphTransform(int
the index into this glyphIndex, AffineTransform GlyphVectorthe new transform of the glyph at newTX)glyphIndexSets the transform of the specified glyph within this
|
| FLAG_COMPLEX_GLYPHS | back to summary |
|---|---|
| public static final int FLAG_COMPLEX_GLYPHS A flag used with getLayoutFlags that indicates that this
| |
| FLAG_HAS_POSITION_ADJUSTMENTS | back to summary |
|---|---|
| public static final int FLAG_HAS_POSITION_ADJUSTMENTS A flag used with getLayoutFlags that indicates that this
| |
| FLAG_HAS_TRANSFORMS | back to summary |
|---|---|
| public static final int FLAG_HAS_TRANSFORMS A flag used with getLayoutFlags that indicates that this
| |
| FLAG_MASK | back to summary |
|---|---|
| public static final int FLAG_MASK A mask for supported flags from getLayoutFlags. Only bits covered by the mask should be tested.
| |
| FLAG_RUN_RTL | back to summary |
|---|---|
| public static final int FLAG_RUN_RTL A flag used with getLayoutFlags that indicates that this
| |
| GlyphVector | back to summary |
|---|---|
| protected GlyphVector() Constructor for subclasses to call. | |
| equals | back to summary |
|---|---|
| public abstract boolean equals(GlyphVector set) Tests if the specified
| |
| getFont | back to summary |
|---|---|
| public abstract Font getFont() Returns the | |
| getFontRenderContext | back to summary |
|---|---|
| public abstract FontRenderContext getFontRenderContext() Returns the
| |
| getGlyphCharIndex | back to summary |
|---|---|
| public int getGlyphCharIndex(int glyphIndex) Returns the character index of the specified glyph. The character index is the index of the first logical character represented by the glyph. The default implementation assumes a one-to-one, left-to-right mapping of glyphs to characters.
| |
| getGlyphCharIndices | back to summary |
|---|---|
| public int[] getGlyphCharIndices(int beginGlyphIndex, int numEntries, int[] codeReturn) Returns the character indices of the specified glyphs. The character index is the index of the first logical character represented by the glyph. Indices are returned in glyph order. The default implementation invokes getGlyphCharIndex for each glyph, and subclassers will probably want to override this implementation for performance reasons. Use this method for convenience and performance in processing of glyphcodes. If no array is passed in, a new array is created.
| |
| getGlyphCode | back to summary |
|---|---|
| public abstract int getGlyphCode(int glyphIndex) Returns the glyphcode of the specified glyph.
This return value is meaningless to anything other
than the
| |
| getGlyphCodes | back to summary |
|---|---|
| public abstract int[] getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn) Returns an array of glyphcodes for the specified glyphs.
The contents of this return value are meaningless to anything other
than the
| |
| getGlyphJustificationInfo | back to summary |
|---|---|
| public abstract GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex) Returns the justification information for the glyph at
the specified index into this
| |
| getGlyphLogicalBounds | back to summary |
|---|---|
| public abstract Shape getGlyphLogicalBounds(int glyphIndex) Returns the logical bounds of the specified glyph within this
| |
| getGlyphMetrics | back to summary |
|---|---|
| public abstract GlyphMetrics getGlyphMetrics(int glyphIndex) Returns the metrics of the glyph at the specified index into
this
| |
| getGlyphOutline | back to summary |
|---|---|
| public abstract Shape getGlyphOutline(int glyphIndex) Returns a
| |
| getGlyphOutline | back to summary |
|---|---|
| public Shape getGlyphOutline(int glyphIndex, float x, float y) Returns a
| |
| getGlyphPixelBounds | back to summary |
|---|---|
| public Rectangle getGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y) Returns the pixel bounds of the glyph at index when this
| |
| getGlyphPosition | back to summary |
|---|---|
| public abstract Point2D getGlyphPosition(int glyphIndex) Returns the position of the specified glyph relative to the
origin of this
| |
| getGlyphPositions | back to summary |
|---|---|
| public abstract float[] getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn) Returns an array of glyph positions for the specified glyphs.
This method is used for convenience and performance when
processing glyph positions.
If no array is passed in, a new array is created.
Even numbered array entries beginning with position zero are the X
coordinates of the glyph numbered
| |
| getGlyphTransform | back to summary |
|---|---|
| public abstract AffineTransform getGlyphTransform(int glyphIndex) Returns the transform of the specified glyph within this
| |
| getGlyphVisualBounds | back to summary |
|---|---|
| public abstract Shape getGlyphVisualBounds(int glyphIndex) Returns the visual bounds of the specified glyph within the
| |
| getLayoutFlags | back to summary |
|---|---|
| public int getLayoutFlags() Returns flags describing the global state of the GlyphVector. Flags not described below are reserved. The default implementation returns 0 (meaning false) for the position adjustments, transforms, rtl, and complex flags. Subclassers should override this method, and make sure it correctly describes the GlyphVector and corresponds to the results of related calls.
| |
| getLogicalBounds | back to summary |
|---|---|
| public abstract Rectangle2D getLogicalBounds() Returns the logical bounds of this
| |
| getNumGlyphs | back to summary |
|---|---|
| public abstract int getNumGlyphs() Returns the number of glyphs in this
| |
| getOutline | back to summary |
|---|---|
| public abstract Shape getOutline() Returns a
| |
| getOutline | back to summary |
|---|---|
| public abstract Shape getOutline(float x, float y) Returns a
| |
| getPixelBounds | back to summary |
|---|---|
| public Rectangle getPixelBounds(FontRenderContext renderFRC, float x, float y) Returns the pixel bounds of this
| |
| getVisualBounds | back to summary |
|---|---|
| public abstract Rectangle2D getVisualBounds() Returns the visual bounds of this
| |
| performDefaultLayout | back to summary |
|---|---|
| public abstract void performDefaultLayout() Assigns default positions to each glyph in this
| |
| setGlyphPosition | back to summary |
|---|---|
| public abstract void setGlyphPosition(int glyphIndex, Point2D newPos) Sets the position of the specified glyph within this
| |
| setGlyphTransform | back to summary |
|---|---|
| public abstract void setGlyphTransform(int glyphIndex, AffineTransform newTX) Sets the transform of the specified glyph within this
| |