Package org.apache.batik.gvt.font
Class Glyph
java.lang.Object
org.apache.batik.gvt.font.Glyph
A Glyph describes a graphics node with some specific glyph rendering
attributes.
- Version:
- $Id: Glyph.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private Rectangle2D
private TextPaintInfo
private Shape
private GraphicsNode
private int
private float
private Point2D
private String
private GVTGlyphMetrics
private Vector
private String
private Shape
private Point2D.Float
private TextPaintInfo
private AffineTransform
private String
private float
private Point2D
-
Constructor Summary
ConstructorsConstructorDescriptionGlyph
(String unicode, List names, String orientation, String arabicForm, String lang, Point2D horizOrigin, Point2D vertOrigin, float horizAdvX, float vertAdvY, int glyphCode, TextPaintInfo tpi, Shape dShape, GraphicsNode glyphChildrenNode) Constructs a Glyph with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D graphics2D) Draws this glyph.Returns which of the four possible arabic forms this glyph represents.int
Returns the glyphs unique code with resect to its font.Returns the metrics of this Glyph if it is used in a horizontal layout.getGlyphMetrics
(float hkern, float vkern) Returns the metrics of this Glyph with the specified kerning value applied.float
Returns the horizontal advance value.Returns the horizontal origin of this glyph.getLang()
Returns a comma separated list of languages this glyph can be used in.getNames()
Returns the names of this glyph.Returns the orientation of this glyph.Returns the outline of this glyph.Returns the position of this glyph.Returns the glpyh's transform.Returns the unicode char or chars this glyph represents.float
Returns the vertical advance value.Returns the vertical origin of this glyph.void
setPosition
(Point2D position) Sets the position of the glyph.void
setTransform
(AffineTransform transform) Sets the transform to be applied to this glyph.
-
Field Details
-
unicode
-
names
-
orientation
-
arabicForm
-
lang
-
horizOrigin
-
vertOrigin
-
horizAdvX
private float horizAdvX -
vertAdvY
private float vertAdvY -
glyphCode
private int glyphCode -
transform
-
position
-
metrics
-
outline
-
bounds
-
tpi
-
cacheTPI
-
dShape
-
glyphChildrenNode
-
-
Constructor Details
-
Glyph
public Glyph(String unicode, List names, String orientation, String arabicForm, String lang, Point2D horizOrigin, Point2D vertOrigin, float horizAdvX, float vertAdvY, int glyphCode, TextPaintInfo tpi, Shape dShape, GraphicsNode glyphChildrenNode) Constructs a Glyph with the specified parameters.
-
-
Method Details
-
getUnicode
Returns the unicode char or chars this glyph represents.- Returns:
- The glyphs unicode value.
-
getNames
Returns the names of this glyph.- Returns:
- The glyph names.
-
getOrientation
Returns the orientation of this glyph. Indicates what inline-progression-direction this glyph can be used in. Should be either "h" for horizontal only, "v" for vertical only, or empty which indicates that the glyph can be used in both.- Returns:
- The glyph orientation.
-
getArabicForm
Returns which of the four possible arabic forms this glyph represents. This is only used for arabic glyphs.- Returns:
- The glyphs arabic form.
-
getLang
Returns a comma separated list of languages this glyph can be used in.- Returns:
- The glyph languages.
-
getHorizOrigin
Returns the horizontal origin of this glyph.- Returns:
- The horizontal origin.
-
getVertOrigin
Returns the vertical origin of this glyph.- Returns:
- The vertical origin.
-
getHorizAdvX
public float getHorizAdvX()Returns the horizontal advance value.- Returns:
- This glyph's horizontal advance.
-
getVertAdvY
public float getVertAdvY()Returns the vertical advance value.- Returns:
- the glyph's vertical advance.
-
getGlyphCode
public int getGlyphCode()Returns the glyphs unique code with resect to its font. This will be the index into the font's list of glyphs.- Returns:
- The glyph's unique code.
-
getTransform
Returns the glpyh's transform.- Returns:
- The glyph's transform.
-
setTransform
Sets the transform to be applied to this glyph.- Parameters:
transform
- The transform to set.
-
getPosition
Returns the position of this glyph.- Returns:
- The glyph's position.
-
setPosition
Sets the position of the glyph.- Parameters:
position
- The new glyph position.
-
getGlyphMetrics
Returns the metrics of this Glyph if it is used in a horizontal layout.- Returns:
- The glyph metrics.
-
getGlyphMetrics
Returns the metrics of this Glyph with the specified kerning value applied.- Parameters:
hkern
- The horizontal kerning value to apply when calculating the glyph metrics.vkern
- The horizontal vertical value to apply when calculating the glyph metrics.- Returns:
- The kerned glyph metics
-
getGeometryBounds
-
getBounds2D
-
getOutline
Returns the outline of this glyph. This will be positioned correctly and any glyph transforms will have been applied.- Returns:
- the outline of this glyph.
-
draw
Draws this glyph.- Parameters:
graphics2D
- The Graphics2D object to draw to.
-