org.apache.batik.gvt.font
Class SVGGVTGlyphVector

java.lang.Object
  |
  +--org.apache.batik.gvt.font.SVGGVTGlyphVector
All Implemented Interfaces:
GVTGlyphVector

public final class SVGGVTGlyphVector
extends java.lang.Object
implements GVTGlyphVector

A GVTGlyphVector class for SVG fonts.


Constructor Summary
SVGGVTGlyphVector(GVTFont font, Glyph[] glyphs, java.awt.font.FontRenderContext frc)
          Constructs an SVGGVTGlyphVector.
 
Method Summary
 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 GylphVector 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 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.
 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 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGGVTGlyphVector

public SVGGVTGlyphVector(GVTFont font,
                         Glyph[] glyphs,
                         java.awt.font.FontRenderContext frc)
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 Detail

getFont

public GVTFont getFont()
Returns the Font associated with this GlyphVector.
Specified by:
getFont in interface GVTGlyphVector

getFontRenderContext

public java.awt.font.FontRenderContext getFontRenderContext()
Returns the FontRenderContext associated with this GlyphVector.
Specified by:
getFontRenderContext in interface GVTGlyphVector

getGlyphCode

public int getGlyphCode(int glyphIndex)
                 throws java.lang.IndexOutOfBoundsException
Returns the glyphcode of the specified glyph.
Specified by:
getGlyphCode in interface GVTGlyphVector

getGlyphCodes

public int[] getGlyphCodes(int beginGlyphIndex,
                           int numEntries,
                           int[] codeReturn)
                    throws java.lang.IndexOutOfBoundsException,
                           java.lang.IllegalArgumentException
Returns an array of glyphcodes for the specified glyphs.
Specified by:
getGlyphCodes in interface GVTGlyphVector

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 interface GVTGlyphVector

getGlyphLogicalBounds

public java.awt.Shape getGlyphLogicalBounds(int glyphIndex)
Returns the logical bounds of the specified glyph within this GlyphVector.
Specified by:
getGlyphLogicalBounds in interface GVTGlyphVector

getGlyphMetrics

public GVTGlyphMetrics getGlyphMetrics(int glyphIndex)
Returns the metrics of the glyph at the specified index into this GlyphVector.
Specified by:
getGlyphMetrics in interface GVTGlyphVector

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 interface GVTGlyphVector

getGlyphPosition

public java.awt.geom.Point2D getGlyphPosition(int glyphIndex)
Returns the position of the specified glyph within this GlyphVector.
Specified by:
getGlyphPosition in interface GVTGlyphVector

getGlyphPositions

public float[] getGlyphPositions(int beginGlyphIndex,
                                 int numEntries,
                                 float[] positionReturn)
Returns an array of glyph positions for the specified glyphs
Specified by:
getGlyphPositions in interface GVTGlyphVector

getGlyphTransform

public java.awt.geom.AffineTransform getGlyphTransform(int glyphIndex)
Gets the transform of the specified glyph within this GlyphVector.
Specified by:
getGlyphTransform in interface GVTGlyphVector

getGlyphVisualBounds

public java.awt.Shape getGlyphVisualBounds(int glyphIndex)
Returns the visual bounds of the specified glyph within the GlyphVector.
Specified by:
getGlyphVisualBounds in interface GVTGlyphVector

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(java.text.AttributedCharacterIterator aci)
Returns a tight bounds on the GylphVector including stroking.
Specified by:
getBounds2D in interface GVTGlyphVector
Following copied from interface: org.apache.batik.gvt.font.GVTGlyphVector
Parameters:
aci - Required to get painting attributes of glyphVector.

getLogicalBounds

public java.awt.geom.Rectangle2D getLogicalBounds()
Returns the logical bounds of this GlyphVector. This is a bound useful for hit detection and highlighting.
Specified by:
getLogicalBounds in interface GVTGlyphVector

getNumGlyphs

public int getNumGlyphs()
Returns the number of glyphs in this GlyphVector.
Specified by:
getNumGlyphs in interface GVTGlyphVector

getOutline

public java.awt.Shape getOutline()
Returns a Shape whose interior corresponds to the visual representation of this GlyphVector.
Specified by:
getOutline in interface GVTGlyphVector

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 interface GVTGlyphVector

getGeometricBounds

public java.awt.geom.Rectangle2D 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:
getGeometricBounds in interface GVTGlyphVector

performDefaultLayout

public void performDefaultLayout()
Assigns default positions to each glyph in this GlyphVector. The default layout is horizontal.
Specified by:
performDefaultLayout in interface GVTGlyphVector

setGlyphPosition

public void setGlyphPosition(int glyphIndex,
                             java.awt.geom.Point2D newPos)
                      throws java.lang.IndexOutOfBoundsException
Sets the position of the specified glyph within this GlyphVector.
Specified by:
setGlyphPosition in interface GVTGlyphVector

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 interface GVTGlyphVector

setGlyphVisible

public void setGlyphVisible(int glyphIndex,
                            boolean visible)
Tells the glyph vector whether or not to draw the specified glyph.
Specified by:
setGlyphVisible in interface GVTGlyphVector

isGlyphVisible

public boolean isGlyphVisible(int glyphIndex)
Returns true if specified glyph will be rendered.
Specified by:
isGlyphVisible in interface GVTGlyphVector

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 interface GVTGlyphVector
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.

draw

public void draw(java.awt.Graphics2D graphics2D,
                 java.text.AttributedCharacterIterator aci)
Draws this glyph vector.
Specified by:
draw in interface GVTGlyphVector


Copyright © 2002 Apache Software Foundation. All Rights Reserved.