|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.bridge.SVGGVTFont
public final class SVGGVTFont
Represents an SVG font.
Field Summary | |
---|---|
static java.text.AttributedCharacterIterator.Attribute |
PAINT_INFO
|
Constructor Summary | |
---|---|
SVGGVTFont(float fontSize,
GVTFontFace fontFace,
java.lang.String[] glyphUnicodes,
java.lang.String[] glyphNames,
java.lang.String[] glyphLangs,
java.lang.String[] glyphOrientations,
java.lang.String[] glyphForms,
BridgeContext ctx,
org.w3c.dom.Element[] glyphElements,
org.w3c.dom.Element missingGlyphElement,
org.w3c.dom.Element[] hkernElements,
org.w3c.dom.Element[] vkernElements,
org.w3c.dom.Element textElement)
Constructs a new SVGGVTFont of the specified size. |
Method Summary | |
---|---|
boolean |
canDisplay(char c)
Indicates whether or not the specified character can be displayed by this font. |
boolean |
canDisplayGivenName(java.lang.String name)
Indicates whether or not the specified glyph can be displayed by this font. |
int |
canDisplayUpTo(char[] text,
int start,
int limit)
Checks whether this Font can display the characters in the specified character array starting at start and ending at limit. |
int |
canDisplayUpTo(java.text.CharacterIterator iter,
int start,
int limit)
Checks whether this Font can display the characters in the specified character iterator starting at start and ending at limit. |
int |
canDisplayUpTo(java.lang.String str)
Checks whether or not this font can display the characters in the specified String. |
GVTGlyphVector |
createGlyphVector(java.awt.font.FontRenderContext frc,
char[] chars)
Returns a new GVTGlyphVector object for the specified array of characters. |
GVTGlyphVector |
createGlyphVector(java.awt.font.FontRenderContext frc,
java.text.CharacterIterator ci)
Returns a new GVTGlyphVector object for the characters in the specified character iterator. |
GVTGlyphVector |
createGlyphVector(java.awt.font.FontRenderContext frc,
int[] glyphCodes,
java.text.CharacterIterator ci)
Returns a new GVTGlyphVector object for the glyphs in the the glyph code array. |
GVTGlyphVector |
createGlyphVector(java.awt.font.FontRenderContext frc,
java.lang.String str)
Returns a new GVTGlyphVector object for the specified String. |
GVTFont |
deriveFont(float size)
Creates a new GVTFont object by replicating this font object and applying a new size to it. |
java.lang.String |
getFamilyName()
Returns the font family name of this font. |
int[] |
getGlyphCodesForName(java.lang.String name)
Returns an array of glyph codes (unique ids) of the glyphs with the specified name (there may be more than one). |
int[] |
getGlyphCodesForUnicode(java.lang.String unicode)
Returns an array of glyph codes (unique ids) of the glyphs with the specified unicode value (there may be more than one). |
float |
getHKern(int glyphCode1,
int glyphCode2)
Returns the horizontal kerning value for the specified glyph pair. |
GVTLineMetrics |
getLineMetrics(char[] chars,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the line metrics for the specified text. |
GVTLineMetrics |
getLineMetrics(java.text.CharacterIterator ci,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the line metrics for the specified text. |
protected GVTLineMetrics |
getLineMetrics(int beginIndex,
int limit)
|
GVTLineMetrics |
getLineMetrics(java.lang.String str,
java.awt.font.FontRenderContext frc)
Returns the line metrics for the specified text. |
GVTLineMetrics |
getLineMetrics(java.lang.String str,
int beginIndex,
int limit,
java.awt.font.FontRenderContext frc)
Returns the line metrics for the specified text. |
float |
getSize()
Returns the size of this font. |
float |
getVKern(int glyphCode1,
int glyphCode2)
Returns the vertical kerning value for the specified glyph pair. |
java.lang.String |
toString()
Returns a string representation of this font. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.text.AttributedCharacterIterator.Attribute PAINT_INFO
Constructor Detail |
---|
public SVGGVTFont(float fontSize, GVTFontFace fontFace, java.lang.String[] glyphUnicodes, java.lang.String[] glyphNames, java.lang.String[] glyphLangs, java.lang.String[] glyphOrientations, java.lang.String[] glyphForms, BridgeContext ctx, org.w3c.dom.Element[] glyphElements, org.w3c.dom.Element missingGlyphElement, org.w3c.dom.Element[] hkernElements, org.w3c.dom.Element[] vkernElements, org.w3c.dom.Element textElement)
fontSize
- The size of the font to create.fontFace
- The font face that describes the font.glyphUnicodes
- An array containing the unicode values for
all the glyphs this font can display.glyphNames
- An array containing the names of all the
glyphs this font can display.ctx
- The bridge context.glyphElements
- An array containing the children glyph
elements of the SVG font.missingGlyphElement
- The missing glyph element for this
font.hkernElements
- An array containing all hkern elements for
this font.vkernElements
- An array containing all vkern elements for
this font.textElement
- The text element that contains the text to
be rendered using this font.Method Detail |
---|
public float getHKern(int glyphCode1, int glyphCode2)
getHKern
in interface GVTFont
glyphCode1
- The id of the first glyph.glyphCode2
- The id of the second glyph.
public float getVKern(int glyphCode1, int glyphCode2)
getVKern
in interface GVTFont
glyphCode1
- The id of the first glyph.glyphCode2
- The id of the second glyph.
public int[] getGlyphCodesForName(java.lang.String name)
name
- The name of the glyph.
public int[] getGlyphCodesForUnicode(java.lang.String unicode)
unicode
- The unicode value of the glyph.
public boolean canDisplayGivenName(java.lang.String name)
name
- The name of the glyph to check.
public boolean canDisplay(char c)
canDisplay
in interface GVTFont
c
- The character to check.
public int canDisplayUpTo(char[] text, int start, int limit)
canDisplayUpTo
in interface GVTFont
text
- An array containing the characters to check.start
- The index of the first character to check.limit
- The index of the last character to check.
public int canDisplayUpTo(java.text.CharacterIterator iter, int start, int limit)
canDisplayUpTo
in interface GVTFont
iter
- The iterator containing the characters to check.start
- The index of the first character to check.limit
- The index of the last character to check.
public int canDisplayUpTo(java.lang.String str)
canDisplayUpTo
in interface GVTFont
str
- The string containing the characters to check.
public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, char[] chars)
createGlyphVector
in interface GVTFont
frc
- The current font render context.chars
- The array of chars that the glyph vector will represent.
public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, java.text.CharacterIterator ci)
createGlyphVector
in interface GVTFont
frc
- The current font render context.ci
- The character iterator that the glyph vector will represent.
public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, int[] glyphCodes, java.text.CharacterIterator ci)
createGlyphVector
in interface GVTFont
frc
- The current font render context.glyphCodes
- An array containin the ids of the glyphs that
the glyph vector will represent.
public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, java.lang.String str)
createGlyphVector
in interface GVTFont
frc
- The current font render context.str
- The string that the glyph vector will represent.
public GVTFont deriveFont(float size)
deriveFont
in interface GVTFont
size
- The size of the new font.
public java.lang.String getFamilyName()
GVTFont
getFamilyName
in interface GVTFont
protected GVTLineMetrics getLineMetrics(int beginIndex, int limit)
public GVTLineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
getLineMetrics
in interface GVTFont
chars
- The character array containing the text.beginIndex
- The index of the first character.limit
- The limit of characters.frc
- The current font render context.
public GVTLineMetrics getLineMetrics(java.text.CharacterIterator ci, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
getLineMetrics
in interface GVTFont
ci
- The character iterator containing the text.beginIndex
- The index of the first character.limit
- The limit of characters.frc
- The current font render context.
public GVTLineMetrics getLineMetrics(java.lang.String str, java.awt.font.FontRenderContext frc)
getLineMetrics
in interface GVTFont
str
- The string containing the text.frc
- The current font render context.
public GVTLineMetrics getLineMetrics(java.lang.String str, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
getLineMetrics
in interface GVTFont
str
- The string containing the text.beginIndex
- The index of the first character.limit
- The limit of characters.frc
- The current font render context.
public float getSize()
getSize
in interface GVTFont
public java.lang.String toString()
toString
in interface GVTFont
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |