iText 8.0.2 API
iText.Kernel.Font.PdfType0Font Class Reference
Inheritance diagram for iText.Kernel.Font.PdfType0Font:
iText.Kernel.Font.PdfFont iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >

Public Member Functions

override Glyph  GetGlyph (int unicode)
  Get glyph by unicode More...
 
override bool  ContainsGlyph (int unicode)
  Check whether font contains glyph with specified unicode. More...
 
override byte[]  ConvertToBytes (String text)
  Converts the text into bytes to be placed in the document. More...
 
override byte[]  ConvertToBytes (GlyphLine glyphLine)
 
override byte[]  ConvertToBytes (Glyph glyph)
 
override void  WriteText (GlyphLine text, int from, int to, PdfOutputStream stream)
 
override void  WriteText (String text, PdfOutputStream stream)
 
override GlyphLine  CreateGlyphLine (String content)
 
override int  AppendGlyphs (String text, int from, int to, IList< Glyph > glyphs)
  Append all supported glyphs and return number of processed chars. More...
 
override int  AppendAnyGlyph (String text, int from, IList< Glyph > glyphs)
  Append any single glyph, even notdef. More...
 
override String  Decode (PdfString content)
 
override GlyphLine  DecodeIntoGlyphLine (PdfString characterCodes)
  Decodes sequence of character codes (e.g. from content stream) into a iText.IO.Font.Otf.GlyphLine More...
 
override bool  AppendDecodedCodesToGlyphsList (IList< Glyph > list, PdfString characterCodes)
  Decodes sequence of character codes (e.g. from content stream) to sequence of glyphs and appends them to the passed list. More...
 
override float  GetContentWidth (PdfString content)
 
override bool  IsBuiltWith (String fontProgram, String encoding)
  Checks whether the PdfFont was built with corresponding fontProgram and encoding or CMAP. More...
 
override void  Flush ()
  To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. More...
 
virtual CMapEncoding  GetCmap ()
  Gets CMAP associated with the Pdf Font. More...
 
virtual PdfStream  GetToUnicode ()
  Creates a ToUnicode CMap to allow copy and paste from Acrobat. More...
 
- Public Member Functions inherited from iText.Kernel.Font.PdfFont
virtual int  GetWidth (int unicode)
  Returns the width of a certain character of this font in 1000 normalized units. More...
 
virtual float  GetWidth (int unicode, float fontSize)
  Returns the width of a certain character of this font in points. More...
 
virtual int  GetWidth (String text)
  Returns the width of a string of this font in 1000 normalized units. More...
 
virtual float  GetWidth (String text, float fontSize)
  Gets the width of a String in points. More...
 
virtual float  GetDescent (String text, float fontSize)
  Gets the descent of a String in points. More...
 
virtual float  GetDescent (int unicode, float fontSize)
  Gets the descent of a char code in points. More...
 
virtual float  GetAscent (String text, float fontSize)
  Gets the ascent of a String in points. More...
 
virtual float  GetAscent (int unicode, float fontSize)
  Gets the ascent of a char code in normalized 1000 units. More...
 
virtual FontProgram  GetFontProgram ()
 
virtual bool  IsEmbedded ()
 
virtual bool  IsSubset ()
  Indicates if all the glyphs and widths for that particular encoding should be included in the document. More...
 
virtual void  SetSubset (bool subset)
  Indicates if all the glyphs and widths for that particular encoding should be included in the document. More...
 
virtual void  AddSubsetRange (int[] range)
  Adds a character range when subsetting. More...
 
virtual IList< String >  SplitString (String text, float fontSize, float maxWidth)
 
override String  ToString ()
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  SetModified ()
 
virtual bool  IsFlushed ()
 

Static Public Member Functions

static String  GetUniMapFromOrdering (String ordering, bool horizontal)
  Get Unicode mapping name from ordering. More...
 

Additional Inherited Members

- Static Public Attributes inherited from iText.Kernel.Font.PdfFont
const int  SIMPLE_FONT_MAX_CHAR_CODE_VALUE = 255
  The upper bound value for char code. More...
 

Member Function Documentation

◆ AppendAnyGlyph()

override int iText.Kernel.Font.PdfType0Font.AppendAnyGlyph ( String  text,
int  from,
IList< Glyph glyphs 
)
inlinevirtual

Append any single glyph, even notdef.

Append any single glyph, even notdef. Returns number of processed chars: 2 in case surrogate pair, otherwise 1.

Parameters
text String to convert to glyphs.
from from index of the text.
glyphs array for a new glyph, shall not be null.
Returns
number of processed chars: 2 in case surrogate pair, otherwise 1

Implements iText.Kernel.Font.PdfFont.

◆ AppendDecodedCodesToGlyphsList()

override bool iText.Kernel.Font.PdfType0Font.AppendDecodedCodesToGlyphsList ( IList< Glyph list,
PdfString  characterCodes 
)
inlinevirtual

Decodes sequence of character codes (e.g. from content stream) to sequence of glyphs and appends them to the passed list.

Reimplemented from iText.Kernel.Font.PdfFont.

◆ AppendGlyphs()

override int iText.Kernel.Font.PdfType0Font.AppendGlyphs ( String  text,
int  from,
int  to,
IList< Glyph glyphs 
)
inlinevirtual

Append all supported glyphs and return number of processed chars.

Append all supported glyphs and return number of processed chars. Composite font supports surrogate pairs.

Parameters
text String to convert to glyphs.
from from index of the text.
to to index of the text.
glyphs array for a new glyphs, shall not be null.
Returns
number of processed chars from text.

Implements iText.Kernel.Font.PdfFont.

◆ ContainsGlyph()

override bool iText.Kernel.Font.PdfType0Font.ContainsGlyph ( int  unicode )
inlinevirtual

Check whether font contains glyph with specified unicode.

Parameters
unicode a unicode code point
Returns
true if font contains glyph, represented with the unicode code point, otherwise false.

Reimplemented from iText.Kernel.Font.PdfFont.

◆ ConvertToBytes()

override byte [] iText.Kernel.Font.PdfType0Font.ConvertToBytes ( String  text )
inlinevirtual

Converts the text into bytes to be placed in the document.

Converts the text into bytes to be placed in the document. The conversion is done according to the font and the encoding and the characters used are stored.

Parameters
text the text to convert
Returns
the conversion

Implements iText.Kernel.Font.PdfFont.

◆ DecodeIntoGlyphLine()

override GlyphLine iText.Kernel.Font.PdfType0Font.DecodeIntoGlyphLine ( PdfString  characterCodes )
inlinevirtual

Decodes sequence of character codes (e.g. from content stream) into a iText.IO.Font.Otf.GlyphLine

Implements iText.Kernel.Font.PdfFont.

◆ Flush()

override void iText.Kernel.Font.PdfType0Font.Flush ( )
inlinevirtual

To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference.

To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call iText.Kernel.Pdf.PdfObjectWrapper.MakeIndirect(iText.Kernel.Pdf.PdfDocument). For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.

Reimplemented from iText.Kernel.Font.PdfFont.

◆ GetCmap()

virtual CMapEncoding iText.Kernel.Font.PdfType0Font.GetCmap ( )
inlinevirtual

Gets CMAP associated with the Pdf Font.

Returns
CMAP
See also
iText.IO.Font.CMapEncoding

◆ GetGlyph()

override Glyph iText.Kernel.Font.PdfType0Font.GetGlyph ( int  unicode )
inlinevirtual

Get glyph by unicode

Parameters
unicode a unicode code point
Returns

iText.IO.Font.Otf.Glyph if it exists or .NOTDEF if supported, otherwise null.

Implements iText.Kernel.Font.PdfFont.

◆ GetToUnicode()

virtual PdfStream iText.Kernel.Font.PdfType0Font.GetToUnicode ( )
inlinevirtual

Creates a ToUnicode CMap to allow copy and paste from Acrobat.

Returns
the stream representing this CMap or null

◆ GetUniMapFromOrdering()

static String iText.Kernel.Font.PdfType0Font.GetUniMapFromOrdering ( String  ordering,
bool  horizontal 
)
inlinestatic

Get Unicode mapping name from ordering.

Parameters
ordering the text ordering to base to unicode mapping on
horizontal identifies whether the encoding is horizontal or vertical
Returns
Unicode mapping name

◆ IsBuiltWith()

override bool iText.Kernel.Font.PdfType0Font.IsBuiltWith ( String  fontProgram,
String  encoding 
)
inlinevirtual

Checks whether the PdfFont was built with corresponding fontProgram and encoding or CMAP.

Checks whether the PdfFont was built with corresponding fontProgram and encoding or CMAP. Default value is false unless overridden.

Parameters
fontProgram a font name or path to a font program
encoding an encoding or CMAP
Returns
true, if the PdfFont was built with the fontProgram and encoding. Otherwise false.
See also
iText.Kernel.Pdf.PdfDocument.FindFont(System.String, System.String), iText.IO.Font.FontProgram.IsBuiltWith(System.String), iText.IO.Font.FontEncoding.IsBuiltWith(System.String), iText.IO.Font.CMapEncoding.IsBuiltWith(System.String)

Reimplemented from iText.Kernel.Font.PdfFont.