Class SVGGVTGlyphVector
java.lang.Object
org.apache.batik.gvt.font.SVGGVTGlyphVector
- All Implemented Interfaces:
GVTGlyphVector
A GVTGlyphVector class for SVG fonts.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSVGGVTGlyphVector(GVTFont font, Glyph[] glyphs, FontRenderContext frc) Constructs an SVGGVTGlyphVector. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D graphics2D, AttributedCharacterIterator aci) Draws this glyph vector.Returns a tight bounds on the GylphVector including stroking.intgetCharacterCount(int startGlyphIndex, int endGlyphIndex) Returns the number of chars represented by the glyphs within the specified range.getFont()Returns the Font associated with this GlyphVector.Returns the FontRenderContext associated with this GlyphVector.Returns the geometric bounds of this GlyphVector.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.intgetGlyphCode(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.getGlyphJustificationInfo(int glyphIndex) Returns the justification information for the glyph at the specified index into this GlyphVector.getGlyphLogicalBounds(int glyphIndex) Returns the logical bounds of the specified glyph within this GlyphVector.getGlyphMetrics(int idx) Returns the metrics of the glyph at the specified index into this GlyphVector.getGlyphOutline(int glyphIndex) Returns a Shape whose interior corresponds to the visual representation of the specified glyph within this GlyphVector.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 glyphsgetGlyphTransform(int glyphIndex) Gets the transform of the specified glyph within this GlyphVector.getGlyphVisualBounds(int glyphIndex) Returns the visual bounds of the specified glyph within the GlyphVector.Returns the logical bounds of this GlyphVector.intReturns the number of glyphs in this GlyphVector.Returns a Shape whose interior corresponds to the visual representation of this GlyphVector.getOutline(float x, float y) Returns a Shape whose interior corresponds to the visual representation of this GlyphVector, offset to x, y.booleanisGlyphVisible(int glyphIndex) Returns true if specified glyph will be rendered.booleanReturn true if glyphs have been reversed.voidmaybeReverse(boolean mirror) Reverse (and optionally mirror) glyphs if not already reversed.voidAssigns default positions to each glyph in this GlyphVector.voidsetGlyphPosition(int glyphIndex, Point2D newPos) Sets the position of the specified glyph within this GlyphVector.voidsetGlyphTransform(int glyphIndex, AffineTransform newTX) Sets the transform of the specified glyph within this GlyphVector.voidsetGlyphVisible(int glyphIndex, boolean visible) Tells the glyph vector whether or not to draw the specified glyph.
-
Field Details
-
PAINT_INFO
-
-
Constructor Details
-
SVGGVTGlyphVector
Constructs an SVGGVTGlyphVector.- Parameters:
font- The font that is creating this glyph vector.glyphs- An array containing the glyphs that form the basis for this glyph vector.frc- The current font render context.
-
-
Method Details
-
getFont
Returns the Font associated with this GlyphVector.- Specified by:
getFontin interfaceGVTGlyphVector
-
getFontRenderContext
Returns the FontRenderContext associated with this GlyphVector.- Specified by:
getFontRenderContextin interfaceGVTGlyphVector
-
getGlyphCode
Returns the glyphcode of the specified glyph.- Specified by:
getGlyphCodein interfaceGVTGlyphVector- Throws:
IndexOutOfBoundsException
-
getGlyphCodes
public int[] getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn) throws IndexOutOfBoundsException, IllegalArgumentException Returns an array of glyphcodes for the specified glyphs.- Specified by:
getGlyphCodesin interfaceGVTGlyphVector- Throws:
IndexOutOfBoundsExceptionIllegalArgumentException
-
getGlyphJustificationInfo
Returns the justification information for the glyph at the specified index into this GlyphVector.- Specified by:
getGlyphJustificationInfoin interfaceGVTGlyphVector
-
getGlyphLogicalBounds
Returns the logical bounds of the specified glyph within this GlyphVector.- Specified by:
getGlyphLogicalBoundsin interfaceGVTGlyphVector
-
getGlyphMetrics
Returns the metrics of the glyph at the specified index into this GlyphVector.- Specified by:
getGlyphMetricsin interfaceGVTGlyphVector
-
getGlyphOutline
Returns a Shape whose interior corresponds to the visual representation of the specified glyph within this GlyphVector.- Specified by:
getGlyphOutlinein interfaceGVTGlyphVector
-
getGlyphCellBounds
Returns the bounding box of the specified glyph, considering only the glyph's metrics (ascent, descent, advance) rather than the actual glyph shape.- Specified by:
getGlyphCellBoundsin interfaceGVTGlyphVector
-
getGlyphPosition
Returns the position of the specified glyph within this GlyphVector.- Specified by:
getGlyphPositionin interfaceGVTGlyphVector
-
getGlyphPositions
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn) Returns an array of glyph positions for the specified glyphs- Specified by:
getGlyphPositionsin interfaceGVTGlyphVector
-
getGlyphTransform
Gets the transform of the specified glyph within this GlyphVector.- Specified by:
getGlyphTransformin interfaceGVTGlyphVector
-
getGlyphVisualBounds
Returns the visual bounds of the specified glyph within the GlyphVector.- Specified by:
getGlyphVisualBoundsin interfaceGVTGlyphVector
-
getBounds2D
Returns a tight bounds on the GylphVector including stroking.- Specified by:
getBounds2Din interfaceGVTGlyphVector- Parameters:
aci- Required to get painting attributes of glyphVector.
-
getLogicalBounds
Returns the logical bounds of this GlyphVector. This is a bound useful for hit detection and highlighting.- Specified by:
getLogicalBoundsin interfaceGVTGlyphVector
-
getNumGlyphs
public int getNumGlyphs()Returns the number of glyphs in this GlyphVector.- Specified by:
getNumGlyphsin interfaceGVTGlyphVector
-
getOutline
Returns a Shape whose interior corresponds to the visual representation of this GlyphVector.- Specified by:
getOutlinein interfaceGVTGlyphVector
-
getOutline
Returns a Shape whose interior corresponds to the visual representation of this GlyphVector, offset to x, y.- Specified by:
getOutlinein interfaceGVTGlyphVector
-
getGeometricBounds
Returns the geometric bounds of this GlyphVector. The geometric bounds is the tightest rectangle enclosing the geometry of the glyph vector (not including stroke).- Specified by:
getGeometricBoundsin interfaceGVTGlyphVector
-
performDefaultLayout
public void performDefaultLayout()Assigns default positions to each glyph in this GlyphVector. The default layout is horizontal.- Specified by:
performDefaultLayoutin interfaceGVTGlyphVector
-
setGlyphPosition
Sets the position of the specified glyph within this GlyphVector.- Specified by:
setGlyphPositionin interfaceGVTGlyphVector- Throws:
IndexOutOfBoundsException
-
setGlyphTransform
Sets the transform of the specified glyph within this GlyphVector.- Specified by:
setGlyphTransformin interfaceGVTGlyphVector
-
setGlyphVisible
public void setGlyphVisible(int glyphIndex, boolean visible) Tells the glyph vector whether or not to draw the specified glyph.- Specified by:
setGlyphVisiblein interfaceGVTGlyphVector
-
isGlyphVisible
public boolean isGlyphVisible(int glyphIndex) Returns true if specified glyph will be rendered.- Specified by:
isGlyphVisiblein interfaceGVTGlyphVector
-
getCharacterCount
public int getCharacterCount(int startGlyphIndex, int endGlyphIndex) Returns the number of chars represented by the glyphs within the specified range.- Specified by:
getCharacterCountin interfaceGVTGlyphVector- Parameters:
startGlyphIndex- The index of the first glyph in the range.endGlyphIndex- The index of the last glyph in the range.- Returns:
- The number of chars.
-
isReversed
public boolean isReversed()Description copied from interface:GVTGlyphVectorReturn true if glyphs have been reversed.- Specified by:
isReversedin interfaceGVTGlyphVector
-
maybeReverse
public void maybeReverse(boolean mirror) Description copied from interface:GVTGlyphVectorReverse (and optionally mirror) glyphs if not already reversed.- Specified by:
maybeReversein interfaceGVTGlyphVector
-
draw
Draws this glyph vector.- Specified by:
drawin interfaceGVTGlyphVector
-