public class AWTGVTGlyphVector extends java.lang.Object implements GVTGlyphVector
Modifier and Type | Field and Description |
---|---|
static java.text.AttributedCharacterIterator.Attribute |
PAINT_INFO |
Constructor and Description |
---|
AWTGVTGlyphVector(java.awt.font.GlyphVector glyphVector,
AWTGVTFont font,
double scaleFactor,
java.text.CharacterIterator ci)
Creates and new AWTGVTGlyphVector from the specified GlyphVector and
AWTGVTFont objects.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D graphics2D,
java.text.AttributedCharacterIterator aci)
Draws this glyph vector.
|
java.awt.geom.Rectangle2D |
getBounds2D(java.text.AttributedCharacterIterator aci)
Returns a tight bounds on the GlyphVector including stroking.
|
int |
getCharacterCount(int startGlyphIndex,
int endGlyphIndex)
Returns the number of chars represented by the glyphs within the
specified range.
|
GVTFont |
getFont()
Returns the GVTFont associated with this GVTGlyphVector.
|
java.awt.font.FontRenderContext |
getFontRenderContext()
Returns the FontRenderContext associated with this GlyphVector.
|
java.awt.geom.Rectangle2D |
getGeometricBounds()
Returns the visual bounds of this GlyphVector The visual bounds is the
tightest rectangle enclosing all non-background pixels in the rendered
representation of this GlyphVector.
|
java.awt.geom.Rectangle2D |
getGlyphCellBounds(int glyphIndex)
Returns the bounding box of the specified glyph, considering only the
glyph's metrics (ascent, descent, advance) rather than the actual glyph
shape.
|
int |
getGlyphCode(int glyphIndex)
Returns the glyphcode of the specified glyph.
|
int[] |
getGlyphCodes(int beginGlyphIndex,
int numEntries,
int[] codeReturn)
Returns an array of glyphcodes for the specified glyphs.
|
java.awt.font.GlyphJustificationInfo |
getGlyphJustificationInfo(int glyphIndex)
Returns the justification information for the glyph at the specified
index into this GlyphVector.
|
java.awt.Shape |
getGlyphLogicalBounds(int glyphIndex)
Returns the logical bounds of the specified glyph within this
GlyphVector.
|
GVTGlyphMetrics |
getGlyphMetrics(int glyphIndex)
Returns the metrics of the glyph at the specified index into this
GVTGlyphVector.
|
java.awt.Shape |
getGlyphOutline(int glyphIndex)
Returns a Shape whose interior corresponds to the visual representation
of the specified glyph within this GlyphVector.
|
java.awt.geom.Point2D |
getGlyphPosition(int glyphIndex)
Returns the position of the specified glyph within this GlyphVector.
|
float[] |
getGlyphPositions(int beginGlyphIndex,
int numEntries,
float[] positionReturn)
Returns an array of glyph positions for the specified glyphs
|
java.awt.geom.AffineTransform |
getGlyphTransform(int glyphIndex)
Gets the transform of the specified glyph within this GlyphVector.
|
java.awt.Shape |
getGlyphVisualBounds(int glyphIndex)
Returns the visual bounds of the specified glyph within the GlyphVector.
|
java.awt.geom.Rectangle2D |
getLogicalBounds()
Returns the logical bounds of this GlyphVector.
|
int |
getNumGlyphs()
Returns the number of glyphs in this GlyphVector.
|
java.awt.Shape |
getOutline()
Returns a Shape whose interior corresponds to the visual representation
of this GlyphVector.
|
java.awt.Shape |
getOutline(float x,
float y)
Returns a Shape whose interior corresponds to the visual representation
of this GlyphVector, offset to x, y.
|
boolean |
isGlyphVisible(int glyphIndex)
Returns true if specified glyph will be rendered.
|
boolean |
isReversed()
Return true if glyphs have been reversed.
|
void |
maybeReverse(boolean mirror)
Reverse (and optionally mirror) glyphs if not
already reversed.
|
void |
performDefaultLayout()
Assigns default positions to each glyph in this GlyphVector.
|
void |
setGlyphPosition(int glyphIndex,
java.awt.geom.Point2D newPos)
Sets the position of the specified glyph within this GlyphVector.
|
void |
setGlyphTransform(int glyphIndex,
java.awt.geom.AffineTransform newTX)
Sets the transform of the specified glyph within this GlyphVector.
|
void |
setGlyphVisible(int glyphIndex,
boolean visible)
Tells the glyph vector whether or not to draw the specified glyph.
|
public static final java.text.AttributedCharacterIterator.Attribute PAINT_INFO
public AWTGVTGlyphVector(java.awt.font.GlyphVector glyphVector, AWTGVTFont font, double scaleFactor, java.text.CharacterIterator ci)
glyphVector
- The glyph vector that this one will be based upon.font
- The font that is creating this glyph vector.scaleFactor
- The scale factor to apply to the glyph vector.
IMPORTANT: This is only required because the GlyphVector class doesn't
handle font sizes less than 1 correctly. By using the scale factor we
can use a GlyphVector created by a larger font and then scale it down to
the correct size.ci
- The character string that this glyph vector represents.public GVTFont getFont()
getFont
in interface GVTGlyphVector
public java.awt.font.FontRenderContext getFontRenderContext()
getFontRenderContext
in interface GVTGlyphVector
public int getGlyphCode(int glyphIndex)
getGlyphCode
in interface GVTGlyphVector
public int[] getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn)
getGlyphCodes
in interface GVTGlyphVector
public java.awt.font.GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex)
getGlyphJustificationInfo
in interface GVTGlyphVector
public java.awt.geom.Rectangle2D getBounds2D(java.text.AttributedCharacterIterator aci)
getBounds2D
in interface GVTGlyphVector
aci
- Required to get painting attributes of glyphVector.public java.awt.geom.Rectangle2D getLogicalBounds()
getLogicalBounds
in interface GVTGlyphVector
public java.awt.Shape getGlyphLogicalBounds(int glyphIndex)
getGlyphLogicalBounds
in interface GVTGlyphVector
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex)
getGlyphMetrics
in interface GVTGlyphVector
public java.awt.Shape getGlyphOutline(int glyphIndex)
getGlyphOutline
in interface GVTGlyphVector
public java.awt.geom.Rectangle2D getGlyphCellBounds(int glyphIndex)
getGlyphCellBounds
in interface GVTGlyphVector
public java.awt.geom.Point2D getGlyphPosition(int glyphIndex)
getGlyphPosition
in interface GVTGlyphVector
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn)
getGlyphPositions
in interface GVTGlyphVector
public java.awt.geom.AffineTransform getGlyphTransform(int glyphIndex)
getGlyphTransform
in interface GVTGlyphVector
public java.awt.Shape getGlyphVisualBounds(int glyphIndex)
getGlyphVisualBounds
in interface GVTGlyphVector
public int getNumGlyphs()
getNumGlyphs
in interface GVTGlyphVector
public java.awt.Shape getOutline()
getOutline
in interface GVTGlyphVector
public java.awt.Shape getOutline(float x, float y)
getOutline
in interface GVTGlyphVector
public java.awt.geom.Rectangle2D getGeometricBounds()
getGeometricBounds
in interface GVTGlyphVector
public void performDefaultLayout()
performDefaultLayout
in interface GVTGlyphVector
public void setGlyphPosition(int glyphIndex, java.awt.geom.Point2D newPos)
setGlyphPosition
in interface GVTGlyphVector
public void setGlyphTransform(int glyphIndex, java.awt.geom.AffineTransform newTX)
setGlyphTransform
in interface GVTGlyphVector
public void setGlyphVisible(int glyphIndex, boolean visible)
setGlyphVisible
in interface GVTGlyphVector
public boolean isGlyphVisible(int glyphIndex)
isGlyphVisible
in interface GVTGlyphVector
public int getCharacterCount(int startGlyphIndex, int endGlyphIndex)
getCharacterCount
in interface GVTGlyphVector
startGlyphIndex
- The index of the first glyph in the range.endGlyphIndex
- The index of the last glyph in the range.public boolean isReversed()
GVTGlyphVector
isReversed
in interface GVTGlyphVector
public void maybeReverse(boolean mirror)
GVTGlyphVector
maybeReverse
in interface GVTGlyphVector
public void draw(java.awt.Graphics2D graphics2D, java.text.AttributedCharacterIterator aci)
draw
in interface GVTGlyphVector
Copyright © 2022 Apache Software Foundation. All Rights Reserved.