public class AWTGVTFont extends Object implements GVTFont
Modifier and Type | Field and Description |
---|---|
protected Font |
awtFont |
static float |
FONT_SIZE |
protected double |
scale |
protected double |
size |
Constructor and Description |
---|
AWTGVTFont(Font font)
Creates a new AWTGVTFont that wraps the given Font.
|
AWTGVTFont(Font font,
double scale)
Creates a new AWTGVTFont that wraps the given Font.
|
AWTGVTFont(Map attributes)
Creates a new AWTGVTFont with the specified attributes.
|
AWTGVTFont(String name,
int style,
int size)
Creates a new AWTGVTFont from the specified name, style and point size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDisplay(char c)
Checks if this font can display the specified character.
|
int |
canDisplayUpTo(char[] text,
int start,
int limit)
Indicates whether or not this font can display the characters in the
specified text starting at start and ending at limit.
|
int |
canDisplayUpTo(CharacterIterator iter,
int start,
int limit)
Indicates whether or not this font can display the the characters in
the specified CharacterIterator starting at start and ending at limit.
|
int |
canDisplayUpTo(String str)
Indicates whether or not this font can display a specified String.
|
GVTGlyphVector |
createGlyphVector(FontRenderContext frc,
char[] chars)
Returns a new GlyphVector object created with the specified array of
characters and the specified FontRenderContext.
|
GVTGlyphVector |
createGlyphVector(FontRenderContext frc,
CharacterIterator ci)
Returns a new GlyphVector object created with the specified
CharacterIterator and the specified FontRenderContext.
|
GVTGlyphVector |
createGlyphVector(FontRenderContext frc,
int[] glyphCodes,
CharacterIterator ci)
Returns a new GlyphVector object created with the specified integer
array and the specified FontRenderContext.
|
GVTGlyphVector |
createGlyphVector(FontRenderContext frc,
String str)
Returns a new GlyphVector object created with the specified String and
the specified FontRenderContext.
|
GVTFont |
deriveFont(float size)
Creates a new Font object by replicating the current Font object and
applying a new size to it.
|
String |
getFamilyName()
Returns the font family name of this font.
|
static AWTGlyphGeometryCache.Value |
getGlyphGeometry(AWTGVTFont font,
char c,
GlyphVector gv,
int glyphIndex,
Point2D glyphPos)
Returns the geometry of the specified character.
|
float |
getHKern(int glyphCode1,
int glyphCode2)
Returns the horizontal kerning value for this glyph pair.
|
GVTLineMetrics |
getLineMetrics(char[] chars,
int beginIndex,
int limit,
FontRenderContext frc)
Returns a LineMetrics object created with the specified arguments.
|
GVTLineMetrics |
getLineMetrics(CharacterIterator ci,
int beginIndex,
int limit,
FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified arguments.
|
GVTLineMetrics |
getLineMetrics(String str,
FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified String and
FontRenderContext.
|
GVTLineMetrics |
getLineMetrics(String str,
int beginIndex,
int limit,
FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified arguments.
|
float |
getSize()
Returns the size of this font.
|
float |
getVKern(int glyphCode1,
int glyphCode2)
Returns the vertical kerning value for this glyph pair.
|
protected Font awtFont
protected double size
protected double scale
public static final float FONT_SIZE
public AWTGVTFont(Font font)
font
- The font object to wrap.public AWTGVTFont(Font font, double scale)
font
- The font object to wrap.scale
- The scale factor to apply to font...public AWTGVTFont(Map attributes)
attributes
- Contains attributes of the font to create.public AWTGVTFont(String name, int style, int size)
name
- The name of the new font.style
- The required font style.size
- The required font size.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(CharacterIterator iter, int start, int limit)
canDisplayUpTo
in interface GVTFont
public int canDisplayUpTo(String str)
canDisplayUpTo
in interface GVTFont
public GVTGlyphVector createGlyphVector(FontRenderContext frc, char[] chars)
createGlyphVector
in interface GVTFont
public GVTGlyphVector createGlyphVector(FontRenderContext frc, CharacterIterator ci)
createGlyphVector
in interface GVTFont
public GVTGlyphVector createGlyphVector(FontRenderContext frc, int[] glyphCodes, CharacterIterator ci)
createGlyphVector
in interface GVTFont
public GVTGlyphVector createGlyphVector(FontRenderContext frc, String str)
createGlyphVector
in interface GVTFont
public GVTFont deriveFont(float size)
deriveFont
in interface GVTFont
public String getFamilyName()
GVTFont
getFamilyName
in interface GVTFont
public GVTLineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, FontRenderContext frc)
getLineMetrics
in interface GVTFont
public GVTLineMetrics getLineMetrics(CharacterIterator ci, int beginIndex, int limit, FontRenderContext frc)
getLineMetrics
in interface GVTFont
public GVTLineMetrics getLineMetrics(String str, FontRenderContext frc)
getLineMetrics
in interface GVTFont
public GVTLineMetrics getLineMetrics(String str, int beginIndex, int limit, FontRenderContext frc)
getLineMetrics
in interface GVTFont
public float getSize()
public float getHKern(int glyphCode1, int glyphCode2)
public float getVKern(int glyphCode1, int glyphCode2)
public static AWTGlyphGeometryCache.Value getGlyphGeometry(AWTGVTFont font, char c, GlyphVector gv, int glyphIndex, Point2D glyphPos)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.