Methods Summary |
---|
public abstract boolean | equals(java.awt.font.GlyphVector set)Tests if the specified GlyphVector exactly
equals this GlyphVector .
|
public abstract java.awt.Font | getFont()Returns the Font associated with this
GlyphVector .
|
public abstract java.awt.font.FontRenderContext | getFontRenderContext()Returns the {@link FontRenderContext} associated with this
GlyphVector .
|
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.
return glyphIndex;
|
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.
if (codeReturn == null) {
codeReturn = new int[numEntries];
}
for (int i = 0, j = beginGlyphIndex; i < numEntries; ++i, ++j) {
codeReturn[i] = getGlyphCharIndex(j);
}
return codeReturn;
|
public abstract int | getGlyphCode(int glyphIndex)Returns the glyphcode of the specified glyph.
This return value is meaningless to anything other
than the Font object that created this
GlyphVector .
|
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 Font used to create this
GlyphVector . This method is used
for convenience and performance when processing glyphcodes.
If no array is passed in, a new array is created.
|
public abstract java.awt.font.GlyphJustificationInfo | getGlyphJustificationInfo(int glyphIndex)Returns the justification information for the glyph at
the specified index into this GlyphVector .
|
public abstract java.awt.Shape | getGlyphLogicalBounds(int glyphIndex)Returns the logical bounds of the specified glyph within this
GlyphVector .
These logical bounds have a total of four edges, with two edges
parallel to the baseline under the glyph's transform and the other two
edges are shared with adjacent glyphs if they are present. This
method is useful for hit-testing of the specified glyph,
positioning of a caret at the leading or trailing edge of a glyph,
and for drawing a highlight region around the specified glyph.
|
public abstract java.awt.font.GlyphMetrics | getGlyphMetrics(int glyphIndex)Returns the metrics of the glyph at the specified index into
this GlyphVector .
|
public abstract java.awt.Shape | getGlyphOutline(int glyphIndex)Returns a Shape whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector .
The outline returned by this method is positioned around the
origin of each individual glyph.
|
public java.awt.Shape | getGlyphOutline(int glyphIndex, float x, float y)Returns a Shape whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector , offset to x, y.
The outline returned by this method is positioned around the
origin of each individual glyph.
Shape s = getGlyphOutline(glyphIndex);
AffineTransform at = AffineTransform.getTranslateInstance(x,y);
return at.createTransformedShape(s);
|
public java.awt.Rectangle | getGlyphPixelBounds(int index, java.awt.font.FontRenderContext renderFRC, float x, float y)Returns the pixel bounds of the glyph at index when this
GlyphVector is rendered in a Graphics with the
given FontRenderContext at the given location. The
renderFRC need not be the same as the
FontRenderContext of this
GlyphVector , and can be null. If it is null, the
FontRenderContext of this GlyphVector
is used. The default implementation returns the visual bounds of the glyph,
offset to x, y and rounded out to the next integer value, and
ignores the FRC. Subclassers should override this method.
Rectangle2D rect = getGlyphVisualBounds(index).getBounds2D();
int l = (int)Math.floor(rect.getX() + x);
int t = (int)Math.floor(rect.getY() + y);
int r = (int)Math.ceil(rect.getMaxX() + x);
int b = (int)Math.ceil(rect.getMaxY() + y);
return new Rectangle(l, t, r - l, b - t);
|
public abstract java.awt.geom.Point2D | getGlyphPosition(int glyphIndex)Returns the position of the specified glyph relative to the
origin of this GlyphVector .
If glyphIndex equals the number of of glyphs in
this GlyphVector , this method returns the position after
the last glyph. This position is used to define the advance of
the entire GlyphVector .
|
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 beginGlyphIndex + position/2 .
Odd numbered array entries beginning with position one are the Y
coordinates of the glyph numbered beginGlyphIndex + (position-1)/2 .
If beginGlyphIndex equals the number of of glyphs in
this GlyphVector , this method gets the position after
the last glyph and this position is used to define the advance of
the entire GlyphVector .
|
public abstract java.awt.geom.AffineTransform | getGlyphTransform(int glyphIndex)Returns the transform of the specified glyph within this
GlyphVector . The transform is relative to the
glyph position. If no special transform has been applied,
null can be returned. A null return indicates
an identity transform.
|
public abstract java.awt.Shape | getGlyphVisualBounds(int glyphIndex)Returns the visual bounds of the specified glyph within the
GlyphVector .
The bounds returned by this method is positioned around the
origin of each individual glyph.
|
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.
return 0;
|
public abstract java.awt.geom.Rectangle2D | getLogicalBounds()Returns the logical bounds of this GlyphVector .
This method is used when positioning this GlyphVector
in relation to visually adjacent GlyphVector objects.
|
public abstract int | getNumGlyphs()Returns the number of glyphs in this GlyphVector .
|
public abstract java.awt.Shape | getOutline()Returns a Shape whose interior corresponds to the
visual representation of this GlyphVector .
|
public abstract java.awt.Shape | getOutline(float x, float y)Returns a Shape whose interior corresponds to the
visual representation of this GlyphVector when
rendered at x, y.
|
public java.awt.Rectangle | getPixelBounds(java.awt.font.FontRenderContext renderFRC, float x, float y)Returns the pixel bounds of this GlyphVector when
rendered in a graphics with the given
FontRenderContext at the given location. The
renderFRC need not be the same as the
FontRenderContext of this
GlyphVector , and can be null. If it is null, the
FontRenderContext of this GlyphVector
is used. The default implementation returns the visual bounds,
offset to x, y and rounded out to the next integer value (i.e. returns an
integer rectangle which encloses the visual bounds) and
ignores the FRC. Subclassers should override this method.
Rectangle2D rect = getVisualBounds();
int l = (int)Math.floor(rect.getX() + x);
int t = (int)Math.floor(rect.getY() + y);
int r = (int)Math.ceil(rect.getMaxX() + x);
int b = (int)Math.ceil(rect.getMaxY() + y);
return new Rectangle(l, t, r - l, b - t);
|
public abstract java.awt.geom.Rectangle2D | getVisualBounds()Returns the visual bounds of this GlyphVector
The visual bounds is the bounding box of the outline of this
GlyphVector . Because of rasterization and
alignment of pixels, it is possible that this box does not
enclose all pixels affected by rendering this GlyphVector .
|
public abstract void | performDefaultLayout()Assigns default positions to each glyph in this
GlyphVector . This can destroy information
generated during initial layout of this GlyphVector .
|
public abstract void | setGlyphPosition(int glyphIndex, java.awt.geom.Point2D newPos)Sets the position of the specified glyph within this
GlyphVector .
If glyphIndex equals the number of of glyphs in
this GlyphVector , this method sets the position after
the last glyph. This position is used to define the advance of
the entire GlyphVector .
|
public abstract void | setGlyphTransform(int glyphIndex, java.awt.geom.AffineTransform newTX)Sets the transform of the specified glyph within this
GlyphVector . The transform is relative to the glyph
position. A null argument for newTX
indicates that no special transform is applied for the specified
glyph.
This method can be used to rotate, mirror, translate and scale the
glyph. Adding a transform can result in signifant performance changes.
|