iText 8.0.2 API
iText.IO.Font.TrueTypeFont Class Reference
Inheritance diagram for iText.IO.Font.TrueTypeFont:
iText.IO.Font.FontProgram iText.Kernel.Font.DocTrueTypeFont

Public Member Functions

  TrueTypeFont (String path)
 
  TrueTypeFont (byte[] ttf)
 
override bool  HasKernPairs ()
 
override int  GetKerning (Glyph first, Glyph second)
  Gets the kerning between two glyphs. More...
 
virtual bool  IsCff ()
 
virtual IDictionary< int, int[]>  GetActiveCmap ()
 
virtual byte[]  GetFontStreamBytes ()
 
override int  GetPdfFontFlags ()
 
virtual int  GetDirectoryOffset ()
  The offset from the start of the file to the table directory. More...
 
virtual GlyphSubstitutionTableReader  GetGsubTable ()
 
virtual GlyphPositioningTableReader  GetGposTable ()
 
virtual OpenTypeGdefTableReader  GetGdefTable ()
 
virtual byte[]  GetSubset (ICollection< int > glyphs, bool subset)
 
virtual ICollection< int >  MapGlyphsCidsToGids (ICollection< int > glyphs)
  Maps a set of glyph CIDs (as used in PDF file) to corresponding GID values (as a glyph primary identifier in the font file). More...
 
virtual String[]  GetCodePagesSupported ()
  Gets the code pages supported by the font. More...
 
override bool  IsBuiltWith (String fontProgram)
  Checks whether the FontProgram was built with corresponding fontName. More...
 
virtual void  Close ()
 
virtual void  UpdateUsedGlyphs (SortedSet< int > usedGlyphs, bool subset, IList< int[]> subsetRanges)
  The method will update usedGlyphs with additional range or with all glyphs if there is no subset. More...
 
- Public Member Functions inherited from iText.IO.Font.FontProgram
virtual int  CountOfGlyphs ()
 
virtual FontNames  GetFontNames ()
 
virtual FontMetrics  GetFontMetrics ()
 
virtual FontIdentification  GetFontIdentification ()
 
virtual String  GetRegistry ()
 
virtual bool  IsFontSpecific ()
 
virtual int  GetWidth (int unicode)
  Get glyph's width. More...
 
virtual int  GetAvgWidth ()
 
virtual int[]  GetCharBBox (int unicode)
  Get glyph's bbox. More...
 
virtual Glyph  GetGlyph (int unicode)
 
virtual Glyph  GetGlyphByCode (int charCode)
 
virtual int  GetKerning (int first, int second)
  Gets the kerning between two glyphs. More...
 
override String  ToString ()
 

Additional Inherited Members

- Static Public Member Functions inherited from iText.IO.Font.FontProgram
static float  ConvertTextSpaceToGlyphSpace (float value)
 
static float  ConvertGlyphSpaceToTextSpace (float value)
 
static double  ConvertGlyphSpaceToTextSpace (double value)
 
static int  ConvertGlyphSpaceToTextSpace (int value)
 
- Static Public Attributes inherited from iText.IO.Font.FontProgram
const int  HORIZONTAL_SCALING_FACTOR = 100
 
const int  DEFAULT_WIDTH = 1000
 
const int  UNITS_NORMALIZATION = 1000
 

Member Function Documentation

◆ GetCodePagesSupported()

virtual String [] iText.IO.Font.TrueTypeFont.GetCodePagesSupported ( )
inlinevirtual

Gets the code pages supported by the font.

Returns
the code pages supported by the font

◆ GetDirectoryOffset()

virtual int iText.IO.Font.TrueTypeFont.GetDirectoryOffset ( )
inlinevirtual

The offset from the start of the file to the table directory.

The offset from the start of the file to the table directory. It is 0 for TTF and may vary for TTC depending on the chosen font.

Returns
directory Offset

◆ GetKerning()

override int iText.IO.Font.TrueTypeFont.GetKerning ( Glyph  first,
Glyph  second 
)
inlinevirtual

Gets the kerning between two glyphs.

Parameters
first the first glyph
second the second glyph
Returns
the kerning to be applied

Implements iText.IO.Font.FontProgram.

◆ IsBuiltWith()

override bool iText.IO.Font.TrueTypeFont.IsBuiltWith ( String  fontName )
inlinevirtual

Checks whether the FontProgram was built with corresponding fontName.

Checks whether the FontProgram was built with corresponding fontName. Default value is false unless overridden.

Parameters
fontName a font name or path to a font program
Returns
true, if the FontProgram was built with the fontProgram. Otherwise false.

Reimplemented from iText.IO.Font.FontProgram.

Reimplemented in iText.Kernel.Font.DocTrueTypeFont.

◆ MapGlyphsCidsToGids()

virtual ICollection iText.IO.Font.TrueTypeFont.MapGlyphsCidsToGids ( ICollection< int >  glyphs )
inlinevirtual

Maps a set of glyph CIDs (as used in PDF file) to corresponding GID values (as a glyph primary identifier in the font file).

Maps a set of glyph CIDs (as used in PDF file) to corresponding GID values (as a glyph primary identifier in the font file). This call is only meaningful for fonts that return true for IsCff(). For other types of fonts, GID and CID are always the same, so that call would essentially return a set of the same values.

Parameters
glyphs a set of glyph CIDs
Returns
a set of glyph ids corresponding to the passed glyph CIDs

◆ UpdateUsedGlyphs()

virtual void iText.IO.Font.TrueTypeFont.UpdateUsedGlyphs ( SortedSet< int >  usedGlyphs,
bool  subset,
IList< int[]>  subsetRanges 
)
inlinevirtual

The method will update usedGlyphs with additional range or with all glyphs if there is no subset.

The method will update usedGlyphs with additional range or with all glyphs if there is no subset. This set of used glyphs can be used for building width array and ToUnicode CMAP.

Parameters
usedGlyphs a set of integers, which are glyph ids that denote used glyphs. This set is updated inside of the method if needed.
subset subset status
subsetRanges additional subset ranges