Package org.apache.batik.extension.svg
Class GlyphIterator
- java.lang.Object
-
- org.apache.batik.extension.svg.GlyphIterator
-
public class GlyphIterator extends java.lang.Object
- Version:
- $Id: GlyphIterator.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.text.AttributedCharacterIterator
aci
(package private) int
aciIdx
(package private) float
adj
(package private) float
adv
(package private) char
ch
(package private) int
charCount
(package private) int
chIdx
static java.text.AttributedCharacterIterator.Attribute
FLOW_LINE_BREAK
(package private) GVTFont
font
(package private) int
fontStart
(package private) java.awt.font.FontRenderContext
frc
(package private) float[]
gp
(package private) GVTGlyphVector
gv
(package private) java.awt.geom.Point2D
gvBase
static java.text.AttributedCharacterIterator.Attribute
GVT_FONT
(package private) int
idx
(package private) int
leftShift
(package private) float[]
leftShiftAmt
(package private) int[]
leftShiftIdx
(package private) int
lineBreakCount
(package private) int
lineBreakRunLimit
(package private) int
lineIdx
(package private) float
maxAscent
(package private) float
maxDescent
(package private) float
maxFontSize
(package private) int
numGlyphs
static java.text.AttributedCharacterIterator.Attribute
PREFORMATTED
(package private) int
runLimit
static char
SOFT_HYPHEN
static java.text.AttributedCharacterIterator.Attribute
TEXT_COMPOUND_ID
(package private) float
width
static char
ZERO_WIDTH_JOINER
static char
ZERO_WIDTH_SPACE
-
Constructor Summary
Constructors Constructor Description GlyphIterator(java.text.AttributedCharacterIterator aci, GVTGlyphVector gv)
GlyphIterator(GlyphIterator gi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addLeftShift(int idx, float chAdv)
GlyphIterator
copy()
GlyphIterator
copy(GlyphIterator gi)
boolean
done()
int
getACIIndex()
float
getAdj()
float
getAdv()
char
getChar()
float
getCharAdvance()
Get the advance associated with the current glyphprotected float
getCharAdvance(int gvIdx)
Get the advance associated with any glyphfloat
getCharWidth()
Get the visual advance associated with the current glyph.protected float
getCharWidth(int gvIdx)
Get the visual advance associated with the current glyph.int
getGlyphIndex()
int
getLineBreaks()
float
getMaxAscent()
float
getMaxDescent()
float
getMaxFontSize()
java.awt.geom.Point2D
getOrigin()
boolean
isBreakChar()
boolean
isLastChar()
boolean
isPrinting()
protected boolean
isPrinting(char tstCH)
LineInfo
newLine(java.awt.geom.Point2D.Float loc, float lineWidth, boolean partial, java.awt.geom.Point2D.Float verticalAlignOffset)
void
nextChar()
Move iterator to the next char.protected void
updateLineMetrics(int end)
-
-
-
Field Detail
-
PREFORMATTED
public static final java.text.AttributedCharacterIterator.Attribute PREFORMATTED
-
FLOW_LINE_BREAK
public static final java.text.AttributedCharacterIterator.Attribute FLOW_LINE_BREAK
-
TEXT_COMPOUND_ID
public static final java.text.AttributedCharacterIterator.Attribute TEXT_COMPOUND_ID
-
GVT_FONT
public static final java.text.AttributedCharacterIterator.Attribute GVT_FONT
-
SOFT_HYPHEN
public static final char SOFT_HYPHEN
- See Also:
- Constant Field Values
-
ZERO_WIDTH_SPACE
public static final char ZERO_WIDTH_SPACE
- See Also:
- Constant Field Values
-
ZERO_WIDTH_JOINER
public static final char ZERO_WIDTH_JOINER
- See Also:
- Constant Field Values
-
idx
int idx
-
chIdx
int chIdx
-
lineIdx
int lineIdx
-
aciIdx
int aciIdx
-
charCount
int charCount
-
adv
float adv
-
adj
float adj
-
runLimit
int runLimit
-
lineBreakRunLimit
int lineBreakRunLimit
-
lineBreakCount
int lineBreakCount
-
font
GVTFont font
-
fontStart
int fontStart
-
maxAscent
float maxAscent
-
maxDescent
float maxDescent
-
maxFontSize
float maxFontSize
-
width
float width
-
ch
char ch
-
numGlyphs
int numGlyphs
-
aci
java.text.AttributedCharacterIterator aci
-
gv
GVTGlyphVector gv
-
gp
float[] gp
-
frc
java.awt.font.FontRenderContext frc
-
leftShiftIdx
int[] leftShiftIdx
-
leftShiftAmt
float[] leftShiftAmt
-
leftShift
int leftShift
-
gvBase
java.awt.geom.Point2D gvBase
-
-
Constructor Detail
-
GlyphIterator
public GlyphIterator(java.text.AttributedCharacterIterator aci, GVTGlyphVector gv)
-
GlyphIterator
public GlyphIterator(GlyphIterator gi)
-
-
Method Detail
-
copy
public GlyphIterator copy()
-
copy
public GlyphIterator copy(GlyphIterator gi)
-
getGlyphIndex
public int getGlyphIndex()
- Returns:
- The index into glyph vector for current character.
-
getChar
public char getChar()
- Returns:
- the current character.
-
getACIIndex
public int getACIIndex()
- Returns:
- The index into Attributed Character iterator for current character.
-
getAdv
public float getAdv()
- Returns:
- The current advance for the line, this is the 'visual width' of the current line.
-
getOrigin
public java.awt.geom.Point2D getOrigin()
- Returns:
- The origin of the glyph vector (the point all glyphs are layed out with respect to).
-
getAdj
public float getAdj()
- Returns:
- The current adjustment for the line. This is the ammount that needs to be subracted from the following line to get it back to the start of the next line.
-
getMaxFontSize
public float getMaxFontSize()
-
getMaxAscent
public float getMaxAscent()
-
getMaxDescent
public float getMaxDescent()
-
isLastChar
public boolean isLastChar()
-
done
public boolean done()
-
isBreakChar
public boolean isBreakChar()
-
isPrinting
protected boolean isPrinting(char tstCH)
-
getLineBreaks
public int getLineBreaks()
-
nextChar
public void nextChar()
Move iterator to the next char.
-
addLeftShift
protected void addLeftShift(int idx, float chAdv)
-
updateLineMetrics
protected void updateLineMetrics(int end)
-
newLine
public LineInfo newLine(java.awt.geom.Point2D.Float loc, float lineWidth, boolean partial, java.awt.geom.Point2D.Float verticalAlignOffset)
-
isPrinting
public boolean isPrinting()
-
getCharAdvance
public float getCharAdvance()
Get the advance associated with the current glyph
-
getCharWidth
public float getCharWidth()
Get the visual advance associated with the current glyph. This is the distance from the location of the glyph to the rightmost part of the glyph.
-
getCharAdvance
protected float getCharAdvance(int gvIdx)
Get the advance associated with any glyph
-
getCharWidth
protected float getCharWidth(int gvIdx)
Get the visual advance associated with the current glyph. This is the distance from the location of the glyph to the rightmost part of the glyph.
-
-