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

Represents a glyph and its Unicode mapping, metrics, and layout adjustments. More...

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 ()
  Returns the code or id by which this is represented in the Font File. More...
 
virtual int  GetWidth ()
  Returns the normalized width of this Glyph. More...
 
virtual int[]  GetBbox ()
  Returns the normalized bbox of this Glyph. More...
 
virtual bool  HasValidUnicode ()
  Determines whether valid unicode applies. More...
 
virtual int  GetUnicode ()
  Returns the unicode (utf-32 representation of Glyph). More...
 
virtual void  SetUnicode (int unicode)
  Updates the Unicode text represented by this Glyph. More...
 
virtual char[]  GetChars ()
  Returns the Unicode text represented by this Glyph. More...
 
virtual void  SetChars (char[] chars)
  Updates the Unicode text represented by this Glyph. More...
 
virtual bool  IsMark ()
  Determines whether this Glyph is Mark. More...
 
virtual short  GetXPlacement ()
  Returns the placement x offset. More...
 
virtual void  SetXPlacement (short xPlacement)
  Updates the placement x offset. More...
 
virtual short  GetYPlacement ()
  Returns the placement y offset. More...
 
virtual void  SetYPlacement (short yPlacement)
  Updates the placement y offset. More...
 
virtual short  GetXAdvance ()
  Returns the advance x offset. More...
 
virtual void  SetXAdvance (short xAdvance)
  Updates the advance x offset. More...
 
virtual short  GetYAdvance ()
  Returns the advance y offset. More...
 
virtual void  SetYAdvance (short yAdvance)
  Updates the advance y offset. More...
 
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 ()
  Returns a string representation of this glyph. More...
 

Detailed Description

Represents a glyph and its Unicode mapping, metrics, and layout adjustments.

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

◆ GetBbox()

virtual int [] iText.IO.Font.Otf.Glyph.GetBbox ( )
inlinevirtual

Returns the normalized bbox of this Glyph.

Returns
the requested result

◆ GetChars()

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

Returns the Unicode text represented by this Glyph.

Returns
the requested result

◆ GetCode()

virtual int iText.IO.Font.Otf.Glyph.GetCode ( )
inlinevirtual

Returns the code or id by which this is represented in the Font File.

Returns
the requested result

◆ GetUnicode()

virtual int iText.IO.Font.Otf.Glyph.GetUnicode ( )
inlinevirtual

Returns the unicode (utf-32 representation of Glyph).

Returns
the requested result

◆ 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

◆ GetWidth()

virtual int iText.IO.Font.Otf.Glyph.GetWidth ( )
inlinevirtual

Returns the normalized width of this Glyph.

Returns
the requested result

◆ GetXAdvance()

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

Returns the advance x offset.

Returns
the requested result

◆ GetXPlacement()

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

Returns the placement x offset.

Returns
the requested result

◆ GetYAdvance()

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

Returns the advance y offset.

Returns
the requested result

◆ GetYPlacement()

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

Returns the placement y offset.

Returns
the requested result

◆ 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

◆ HasValidUnicode()

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

Determines whether valid unicode applies.

Returns

true if the operation succeeds; otherwise false

◆ IsMark()

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

Determines whether this Glyph is Mark.

Returns

true if this Glyph is Mark; otherwise false

◆ 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

◆ SetChars()

virtual void iText.IO.Font.Otf.Glyph.SetChars ( char[]  chars )
inlinevirtual

Updates the Unicode text represented by this Glyph.

Parameters
chars the Unicode text represented by this Glyph

◆ SetUnicode()

virtual void iText.IO.Font.Otf.Glyph.SetUnicode ( int  unicode )
inlinevirtual

Updates the Unicode text represented by this Glyph.

Parameters
unicode the utf-32 representation of Glyph

◆ SetXAdvance()

virtual void iText.IO.Font.Otf.Glyph.SetXAdvance ( short  xAdvance )
inlinevirtual

Updates the advance x offset.

Parameters
xAdvance the x advance

◆ SetXPlacement()

virtual void iText.IO.Font.Otf.Glyph.SetXPlacement ( short  xPlacement )
inlinevirtual

Updates the placement x offset.

Parameters
xPlacement the x offset for placement

◆ SetYAdvance()

virtual void iText.IO.Font.Otf.Glyph.SetYAdvance ( short  yAdvance )
inlinevirtual

Updates the advance y offset.

Parameters
yAdvance the y advance

◆ SetYPlacement()

virtual void iText.IO.Font.Otf.Glyph.SetYPlacement ( short  yPlacement )
inlinevirtual

Updates the placement y offset.

Parameters
yPlacement the y offset for placement

◆ ToString()

override String iText.IO.Font.Otf.Glyph.ToString ( )
inline

Returns a string representation of this glyph.

Returns
the requested result