Class Glyph
public class Glyph
- Inheritance
-
Glyph
- Inherited Members
Constructors
Glyph(int, int)
Construct a non-mark Glyph object with id -1 and characters retrieved from unicode.
public Glyph(int width, int unicode)
Parameters
width
intnormalized width of the glyph
unicode
intutf-32 representation of glyph if appears. Correct value is > -1
Glyph(int, int, char[])
Construct a non-mark Glyph, using the codepoint of the characters as unicode point.
public Glyph(int code, int width, char[] chars)
Parameters
code
intcode representation of the glyph in the font file
width
intnormalized width of the glyph
chars
char[]The Unicode text represented by this Glyph.
Glyph(int, int, int)
Construct a non-mark Glyph, retrieving characters from unicode.
public Glyph(int code, int width, int unicode)
Parameters
code
intcode representation of the glyph in the font file
width
intnormalized width of the glyph
unicode
intutf-32 representation of glyph if appears. Correct value is > -1
Glyph(int, int, int, char[], bool)
Construct a glyph object form the passed arguments.
public Glyph(int code, int width, int unicode, char[] chars, bool IsMark)
Parameters
code
intcode representation of the glyph in the font file
width
intnormalized width of the glyph
unicode
intutf-32 representation of glyph if appears. Correct value is > -1
chars
char[]The Unicode text represented by this Glyph. if null is passed, the unicode value is used to retrieve the chars.
IsMark
boolTrue if the glyph is a Mark
Glyph(int, int, int, int[])
Construct a non-mark Glyph, retrieving characters from unicode.
public Glyph(int code, int width, int unicode, int[] bbox)
Parameters
code
intcode representation of the glyph in the font file
width
intnormalized width of the glyph
unicode
intutf-32 representation of glyph if appears. Correct value is > -1
bbox
int[]The normalized bounding box of this Glyph.
Glyph(Glyph)
Copy a Glyph.
public Glyph(Glyph glyph)
Parameters
glyph
GlyphGlyph to copy
Glyph(Glyph, int)
Copy a glyph and assign the copied glyph a new unicode point and characters
public Glyph(Glyph glyph, int unicode)
Parameters
Glyph(Glyph, int, int, int, int, int)
Copy a Glyph and assign new placement and advance offsets and a new index delta to base glyph
public Glyph(Glyph glyph, int xPlacement, int yPlacement, int xAdvance, int yAdvance, int anchorDelta)
Parameters
glyph
GlyphGlyph to copy
xPlacement
intx - placement offset
yPlacement
inty - placement offset
xAdvance
intx - advance offset
yAdvance
inty - advance offset
anchorDelta
intIndex delta to base glyph. If after a glyph there are several anchored glyphs we should know we to find base glyph.
Methods
Equals(object)
Two Glyphs are equal if their unicode characters, code and normalized width are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object
Returns
- bool
True if this equals obj cast to Glyph, false otherwise.
GetAnchorDelta()
public virtual short GetAnchorDelta()
Returns
GetBbox()
public virtual int[] GetBbox()
Returns
- int[]
GetChars()
public virtual char[] GetChars()
Returns
- char[]
GetCode()
public virtual int GetCode()
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetUnicode()
public virtual int GetUnicode()
Returns
GetUnicodeChars()
Gets Unicode char sequence corresponding to this glyph.
public virtual char[] GetUnicodeChars()
Returns
- char[]
the Unicode char sequence that corresponds to this glyph
Remarks
Gets Unicode char sequence corresponding to this glyph. In general case it might consist of many characters. If this glyph does not have a valid unicode ( HasValidUnicode() ), then a special Unicode '\ufffd' character is returned.
GetUnicodeString()
Gets a Unicode string corresponding to this glyph.
public virtual string GetUnicodeString()
Returns
- string
the Unicode string that corresponds to this glyph
Remarks
Gets a Unicode string corresponding to this glyph. In general case it might consist of many characters. If this glyph does not have a valid unicode ( HasValidUnicode() ), then a string consisting of a special Unicode '\ufffd' character is returned.
GetWidth()
public virtual int GetWidth()
Returns
GetXAdvance()
public virtual short GetXAdvance()
Returns
GetXPlacement()
public virtual short GetXPlacement()
Returns
GetYAdvance()
public virtual short GetYAdvance()
Returns
GetYPlacement()
public virtual short GetYPlacement()
Returns
HasAdvance()
public virtual bool HasAdvance()
Returns
HasOffsets()
public virtual bool HasOffsets()
Returns
HasPlacement()
public virtual bool HasPlacement()
Returns
HasValidUnicode()
public virtual bool HasValidUnicode()
Returns
IsMark()
public virtual bool IsMark()
Returns
SetAnchorDelta(short)
public virtual void SetAnchorDelta(short anchorDelta)
Parameters
anchorDelta
short
SetChars(char[])
public virtual void SetChars(char[] chars)
Parameters
chars
char[]
SetUnicode(int)
public virtual void SetUnicode(int unicode)
Parameters
unicode
int
SetXAdvance(short)
public virtual void SetXAdvance(short xAdvance)
Parameters
xAdvance
short
SetXPlacement(short)
public virtual void SetXPlacement(short xPlacement)
Parameters
xPlacement
short
SetYAdvance(short)
public virtual void SetYAdvance(short yAdvance)
Parameters
yAdvance
short
SetYPlacement(short)
public virtual void SetYPlacement(short yPlacement)
Parameters
yPlacement
short
ToString()
public override string ToString()