Glyph

Inheritance: java.lang.Object

public class Glyph

Represents a glyph

Constructors

ConstructorDescription
Glyph(int glyphIndex, short advance, short advanceOffset, short ascenderOffset)Initializes new instance of this class.

Methods

MethodDescription
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:

ParameterTypeDescription
glyphIndexintGlyph index.
advanceshortAdvance metric of the glyph.
advanceOffsetshortHorizontal (x) offset.
ascenderOffsetshortVertical (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:

ParameterTypeDescription
emint
fontSizefloat

Returns: float

setAdvance(short value)

public void setAdvance(short value)

Advance width indicating placement for the subsequent glyph.

Parameters:

ParameterTypeDescription
valueshortThe corresponding short value.