iText 9.7.0 API
iText.IO.Font.Otf.Glyph Class Reference

Public Member Functions

  Glyph (int code, int width, int unicode)
  Construct a non-mark Glyph, retrieving characters from unicode. More...
 
  Glyph (int code, int width, char[] chars)
  Construct a non-mark Glyph, using the codepoint of the characters as unicode point. More...
 
  Glyph (int code, int width, int unicode, int[] bbox)
  Construct a non-mark Glyph, retrieving characters from unicode. More...
 
  Glyph (int width, int unicode)
  Construct a non-mark Glyph object with id -1 and characters retrieved from unicode. More...
 
  Glyph (int code, int width, int unicode, char[] chars, bool IsMark)
  Construct a glyph object form the passed arguments. More...
 
  Glyph (iText.IO.Font.Otf.Glyph glyph)
  Copy a Glyph. More...
 
  Glyph (iText.IO.Font.Otf.Glyph glyph, int xAdvance, int yAdvance)
  Copy a Glyph and assign new advance offsets. More...
 
  Glyph (iText.IO.Font.Otf.Glyph glyph, int xPlacement, int yPlacement, int xAdvance, int yAdvance, int anchorDelta)
  Copy a Glyph and assign new placement and advance offsets and a new index delta to base glyph. More...
 
  Glyph (iText.IO.Font.Otf.Glyph glyph, int unicode)
  Copy a glyph and assign the copied glyph a new unicode point and characters More...
 
virtual int  GetCode ()
 
virtual int  GetWidth ()
 
virtual int[]  GetBbox ()
 
virtual bool  HasValidUnicode ()
 
virtual int  GetUnicode ()
 
virtual void  SetUnicode (int unicode)
 
virtual char[]  GetChars ()
 
virtual void  SetChars (char[] chars)
 
virtual bool  IsMark ()
 
virtual short  GetXPlacement ()
 
virtual void  SetXPlacement (short xPlacement)
 
virtual short  GetYPlacement ()
 
virtual void  SetYPlacement (short yPlacement)
 
virtual short  GetXAdvance ()
 
virtual void  SetXAdvance (short xAdvance)
 
virtual short  GetYAdvance ()
 
virtual void  SetYAdvance (short yAdvance)
 
virtual short  GetAnchorDelta ()
  Gets the index delta to base glyph. More...
 
virtual void  SetAnchorDelta (short anchorDelta)
  Sets the index delta to base glyph. More...
 
virtual bool  HasOffsets ()
  Checks whether the glyph has any offsets either own or advance or both at the same time. More...
 
virtual bool  HasPlacement ()
  Checks whether the glyph has own offsets: either for X axis or Y axis or both at the same time. More...
 
virtual bool  HasAdvance ()
  Checks whether the glyph has advance offsets: either for X axis or Y axis or both at the same time. More...
 
override int  GetHashCode ()
 
override bool  Equals (Object obj)
  Two Glyphs are equal if their unicode characters, code and normalized width are equal. More...
 
virtual String  GetUnicodeString ()
  Gets a Unicode string corresponding to this glyph. More...
 
virtual char[]  GetUnicodeChars ()
  Gets Unicode char sequence corresponding to this glyph. More...
 
override String  ToString ()
 

Constructor & Destructor Documentation

◆ Glyph() [1/9]

iText.IO.Font.Otf.Glyph.Glyph ( int  code,
int  width,
int  unicode 
)
inline

Construct a non-mark Glyph, retrieving characters from unicode.

Parameters
code code representation of the glyph in the font file
width normalized width of the glyph
unicode utf-32 representation of glyph if appears. Correct value is > -1

◆ Glyph() [2/9]

iText.IO.Font.Otf.Glyph.Glyph ( int  code,
int  width,
char[]  chars 
)
inline

Construct a non-mark Glyph, using the codepoint of the characters as unicode point.

Parameters
code code representation of the glyph in the font file
width normalized width of the glyph
chars The Unicode text represented by this Glyph.

◆ Glyph() [3/9]

iText.IO.Font.Otf.Glyph.Glyph ( int  code,
int  width,
int  unicode,
int[]  bbox 
)
inline

Construct a non-mark Glyph, retrieving characters from unicode.

Parameters
code code representation of the glyph in the font file
width normalized width of the glyph
unicode utf-32 representation of glyph if appears. Correct value is > -1
bbox The normalized bounding box of this Glyph.

◆ Glyph() [4/9]

iText.IO.Font.Otf.Glyph.Glyph ( int  width,
int  unicode 
)
inline

Construct a non-mark Glyph object with id -1 and characters retrieved from unicode.

Parameters
width normalized width of the glyph
unicode utf-32 representation of glyph if appears. Correct value is > -1

◆ Glyph() [5/9]

iText.IO.Font.Otf.Glyph.Glyph ( int  code,
int  width,
int  unicode,
char[]  chars,
bool  IsMark 
)
inline

Construct a glyph object form the passed arguments.

Parameters
code code representation of the glyph in the font file
width normalized width of the glyph
unicode utf-32 representation of glyph if appears. Correct value is > -1
chars The Unicode text represented by this Glyph. if null is passed, the unicode value is used to retrieve the chars.
IsMark True if the glyph is a Mark

◆ Glyph() [6/9]

iText.IO.Font.Otf.Glyph.Glyph ( iText.IO.Font.Otf.Glyph  glyph )
inline

Copy a Glyph.

Parameters
glyph Glyph to copy

◆ Glyph() [7/9]

iText.IO.Font.Otf.Glyph.Glyph ( iText.IO.Font.Otf.Glyph  glyph,
int  xAdvance,
int  yAdvance 
)
inline

Copy a Glyph and assign new advance offsets.

Parameters
glyph Glyph to copy
xAdvance x - advance offset
yAdvance y - advance offset

◆ Glyph() [8/9]

iText.IO.Font.Otf.Glyph.Glyph ( iText.IO.Font.Otf.Glyph  glyph,
int  xPlacement,
int  yPlacement,
int  xAdvance,
int  yAdvance,
int  anchorDelta 
)
inline

Copy a Glyph and assign new placement and advance offsets and a new index delta to base glyph.

Parameters
glyph Glyph to copy
xPlacement x - placement offset
yPlacement y - placement offset
xAdvance x - advance offset
yAdvance y - advance offset
anchorDelta Index delta to base glyph. If after a glyph there are several anchored glyphs we should know we to find base glyph.

◆ Glyph() [9/9]

iText.IO.Font.Otf.Glyph.Glyph ( iText.IO.Font.Otf.Glyph  glyph,
int  unicode 
)
inline

Copy a glyph and assign the copied glyph a new unicode point and characters

Parameters
glyph glyph to copy
unicode new unicode point

Member Function Documentation

◆ Equals()

override bool iText.IO.Font.Otf.Glyph.Equals ( Object  obj )
inline

Two Glyphs are equal if their unicode characters, code and normalized width are equal.

Parameters
obj еhe object
Returns

true if this equals obj cast to Glyph, false otherwise

◆ GetAnchorDelta()

virtual short iText.IO.Font.Otf.Glyph.GetAnchorDelta ( )
inlinevirtual

Gets the index delta to base glyph.

Returns
the index delta to base glyph

◆ GetUnicodeChars()

virtual char [] iText.IO.Font.Otf.Glyph.GetUnicodeChars ( )
inlinevirtual

Gets Unicode char sequence corresponding to this glyph.

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.

Returns
the Unicode char sequence that corresponds to this glyph

◆ GetUnicodeString()

virtual String iText.IO.Font.Otf.Glyph.GetUnicodeString ( )
inlinevirtual

Gets a Unicode string corresponding to this glyph.

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.

Returns
the Unicode string that corresponds to this glyph

◆ HasAdvance()

virtual bool iText.IO.Font.Otf.Glyph.HasAdvance ( )
inlinevirtual

Checks whether the glyph has advance offsets: either for X axis or Y axis or both at the same time.

Returns

true if glyph has any advance offsets, false otherwise

◆ HasOffsets()

virtual bool iText.IO.Font.Otf.Glyph.HasOffsets ( )
inlinevirtual

Checks whether the glyph has any offsets either own or advance or both at the same time.

Checks whether the glyph has any offsets either own or advance or both at the same time.

See HasPlacement() and HasAdvance().

Returns

true if glyph has any offsets, false otherwise

◆ HasPlacement()

virtual bool iText.IO.Font.Otf.Glyph.HasPlacement ( )
inlinevirtual

Checks whether the glyph has own offsets: either for X axis or Y axis or both at the same time.

Returns

true if glyph has any own offsets, false otherwise

◆ SetAnchorDelta()

virtual void iText.IO.Font.Otf.Glyph.SetAnchorDelta ( short  anchorDelta )
inlinevirtual

Sets the index delta to base glyph.

Parameters
anchorDelta the index delta to base glyph to be set