Glyph
Inheritance: java.lang.Object
public class Glyph
Represents a glyph
Constructors
Constructor | Description |
---|---|
Glyph(int glyphIndex, short advance, short advanceOffset, short ascenderOffset) | Initializes new instance of this class. |
Methods
Method | Description |
---|---|
deepClone() | Returns a clone of this instance. |
getAdvance() | Advance width indicating placement for the subsequent glyph. |
getAdvanceOffset() | Horizontal (x) offset relative to glyph position. |
getAscenderOffset() | Vertical (y) offset relative to glyph position. |
getGlyphIndex() | Index of the glyph (GID) in the physical font. |
getWidth(int em, float fontSize) | Returns width (advance) of the glyph in points. |
setAdvance(short value) | Advance width indicating placement for the subsequent glyph. |
Glyph(int glyphIndex, short advance, short advanceOffset, short ascenderOffset)
public Glyph(int glyphIndex, short advance, short advanceOffset, short ascenderOffset)
Initializes new instance of this class.
Parameters:
Parameter | Type | Description |
---|---|---|
glyphIndex | int | Glyph index. |
advance | short | Advance metric of the glyph. |
advanceOffset | short | Horizontal (x) offset. |
ascenderOffset | short | Vertical (y) offset. |
deepClone()
public Glyph deepClone()
Returns a clone of this instance.
Returns: Glyph
getAdvance()
public short getAdvance()
Advance width indicating placement for the subsequent glyph.
Returns: short - The corresponding short value.
getAdvanceOffset()
public short getAdvanceOffset()
Horizontal (x) offset relative to glyph position. Mostly used to attach marks (like diacritics) to base characters.
Returns: short - The corresponding short value.
getAscenderOffset()
public short getAscenderOffset()
Vertical (y) offset relative to glyph position. Mostly used to attach marks (like diacritics) to base characters.
Returns: short - The corresponding short value.
getGlyphIndex()
public int getGlyphIndex()
Index of the glyph (GID) in the physical font.
Returns: int - The corresponding int value.
getWidth(int em, float fontSize)
public float getWidth(int em, float fontSize)
Returns width (advance) of the glyph in points.
Parameters:
Parameter | Type | Description |
---|---|---|
em | int | |
fontSize | float |
Returns: float
setAdvance(short value)
public void setAdvance(short value)
Advance width indicating placement for the subsequent glyph.
Parameters:
Parameter | Type | Description |
---|---|---|
value | short | The corresponding short value. |