Package org.apache.batik.gvt.font
Class MultiGlyphVector
- java.lang.Object
-
- org.apache.batik.gvt.font.MultiGlyphVector
-
- All Implemented Interfaces:
GVTGlyphVector
public class MultiGlyphVector extends java.lang.Object implements GVTGlyphVector
- Version:
- $Id: MultiGlyphVector.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) GVTGlyphVector[]
gvs
(package private) int
nGlyph
(package private) int[]
nGlyphs
(package private) int[]
off
-
Constructor Summary
Constructors Constructor Description MultiGlyphVector(java.util.List gvs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(java.awt.Graphics2D g2d, java.text.AttributedCharacterIterator aci)
Draws the glyph vector.java.awt.geom.Rectangle2D
getBounds2D(java.text.AttributedCharacterIterator aci)
Returns the bounds of this GlyphVector.int
getCharacterCount(int startGlyphIndex, int endGlyphIndex)
Returns the number of chars represented by the glyphs within the specified range.GVTFont
getFont()
Returns the Font associated with this GlyphVector.java.awt.font.FontRenderContext
getFontRenderContext()
Returns the FontRenderContext associated with this GlyphVector.java.awt.geom.Rectangle2D
getGeometricBounds()
Returns the geometric bounds 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 GlyphVector.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 glyphsjava.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.(package private) int
getGVIdx(int glyphIdx)
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 drawn.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.
-
-
-
Field Detail
-
gvs
GVTGlyphVector[] gvs
-
nGlyphs
int[] nGlyphs
-
off
int[] off
-
nGlyph
int nGlyph
-
-
Method Detail
-
getNumGlyphs
public int getNumGlyphs()
Returns the number of glyphs in this GlyphVector.- Specified by:
getNumGlyphs
in interfaceGVTGlyphVector
-
getGVIdx
int getGVIdx(int glyphIdx)
-
getFont
public GVTFont getFont()
Returns the Font associated with this GlyphVector.- Specified by:
getFont
in interfaceGVTGlyphVector
-
getFontRenderContext
public java.awt.font.FontRenderContext getFontRenderContext()
Returns the FontRenderContext associated with this GlyphVector.- Specified by:
getFontRenderContext
in interfaceGVTGlyphVector
-
getGlyphCode
public int getGlyphCode(int glyphIndex)
Returns the glyphcode of the specified glyph.- Specified by:
getGlyphCode
in interfaceGVTGlyphVector
-
getGlyphJustificationInfo
public java.awt.font.GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex)
Returns the justification information for the glyph at the specified index into this GlyphVector.- Specified by:
getGlyphJustificationInfo
in interfaceGVTGlyphVector
-
getGlyphLogicalBounds
public java.awt.Shape getGlyphLogicalBounds(int glyphIndex)
Returns the logical bounds of the specified glyph within this GlyphVector.- Specified by:
getGlyphLogicalBounds
in interfaceGVTGlyphVector
-
getGlyphMetrics
public GVTGlyphMetrics getGlyphMetrics(int glyphIndex)
Returns the metrics of the glyph at the specified index into this GlyphVector.- Specified by:
getGlyphMetrics
in interfaceGVTGlyphVector
-
getGlyphOutline
public java.awt.Shape getGlyphOutline(int glyphIndex)
Returns a Shape whose interior corresponds to the visual representation of the specified glyph within this GlyphVector.- Specified by:
getGlyphOutline
in interfaceGVTGlyphVector
-
getGlyphCellBounds
public 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.- Specified by:
getGlyphCellBounds
in interfaceGVTGlyphVector
-
getGlyphPosition
public java.awt.geom.Point2D getGlyphPosition(int glyphIndex)
Returns the position of the specified glyph within this GlyphVector.- Specified by:
getGlyphPosition
in interfaceGVTGlyphVector
-
getGlyphTransform
public java.awt.geom.AffineTransform getGlyphTransform(int glyphIndex)
Gets the transform of the specified glyph within this GlyphVector.- Specified by:
getGlyphTransform
in interfaceGVTGlyphVector
-
getGlyphVisualBounds
public java.awt.Shape getGlyphVisualBounds(int glyphIndex)
Returns the visual bounds of the specified glyph within the GlyphVector.- Specified by:
getGlyphVisualBounds
in interfaceGVTGlyphVector
-
setGlyphPosition
public void setGlyphPosition(int glyphIndex, java.awt.geom.Point2D newPos)
Sets the position of the specified glyph within this GlyphVector.- Specified by:
setGlyphPosition
in interfaceGVTGlyphVector
-
setGlyphTransform
public void setGlyphTransform(int glyphIndex, java.awt.geom.AffineTransform newTX)
Sets the transform of the specified glyph within this GlyphVector.- Specified by:
setGlyphTransform
in interfaceGVTGlyphVector
-
setGlyphVisible
public void setGlyphVisible(int glyphIndex, boolean visible)
Tells the glyph vector whether or not to draw the specified glyph.- Specified by:
setGlyphVisible
in interfaceGVTGlyphVector
-
isGlyphVisible
public boolean isGlyphVisible(int glyphIndex)
Returns true if specified glyph will be drawn.- Specified by:
isGlyphVisible
in interfaceGVTGlyphVector
-
getGlyphCodes
public int[] getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn)
Returns an array of glyphcodes for the specified glyphs.- Specified by:
getGlyphCodes
in interfaceGVTGlyphVector
-
getGlyphPositions
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn)
Returns an array of glyph positions for the specified glyphs- Specified by:
getGlyphPositions
in interfaceGVTGlyphVector
-
getLogicalBounds
public java.awt.geom.Rectangle2D getLogicalBounds()
Returns the logical bounds of this GlyphVector.- Specified by:
getLogicalBounds
in interfaceGVTGlyphVector
-
getOutline
public java.awt.Shape getOutline()
Returns a Shape whose interior corresponds to the visual representation of this GlyphVector.- Specified by:
getOutline
in interfaceGVTGlyphVector
-
getOutline
public 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.- Specified by:
getOutline
in interfaceGVTGlyphVector
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.text.AttributedCharacterIterator aci)
Returns the bounds of this GlyphVector. This includes stroking effects.- Specified by:
getBounds2D
in interfaceGVTGlyphVector
- Parameters:
aci
- Required to get painting attributes of glyphVector.
-
getGeometricBounds
public java.awt.geom.Rectangle2D getGeometricBounds()
Returns the geometric bounds of this GlyphVector. The geometric bounds is the bounds of the geometry of the glyph vector, disregarding stroking.- Specified by:
getGeometricBounds
in interfaceGVTGlyphVector
-
performDefaultLayout
public void performDefaultLayout()
Description copied from interface:GVTGlyphVector
Assigns default positions to each glyph in this GlyphVector.- Specified by:
performDefaultLayout
in interfaceGVTGlyphVector
-
getCharacterCount
public int getCharacterCount(int startGlyphIndex, int endGlyphIndex)
Returns the number of chars represented by the glyphs within the specified range.- Specified by:
getCharacterCount
in 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:GVTGlyphVector
Return true if glyphs have been reversed.- Specified by:
isReversed
in interfaceGVTGlyphVector
-
maybeReverse
public void maybeReverse(boolean mirror)
Description copied from interface:GVTGlyphVector
Reverse (and optionally mirror) glyphs if not already reversed.- Specified by:
maybeReverse
in interfaceGVTGlyphVector
-
draw
public void draw(java.awt.Graphics2D g2d, java.text.AttributedCharacterIterator aci)
Draws the glyph vector.- Specified by:
draw
in interfaceGVTGlyphVector
-
-