iText 8.0.2 API
iText.Kernel.Font.PdfFontFactory Class Reference

This class provides helpful methods for creating fonts ready to be used in a iText.Kernel.Pdf.PdfDocument More...

Public Types

enum   EmbeddingStrategy { EmbeddingStrategy.FORCE_EMBEDDED, EmbeddingStrategy.FORCE_NOT_EMBEDDED, EmbeddingStrategy.PREFER_EMBEDDED, EmbeddingStrategy.PREFER_NOT_EMBEDDED }
  Enum values for font embedding strategies. More...
 

Static Public Member Functions

static PdfFont  CreateFont ()
  Creates a new instance of default font, namely iText.IO.Font.Constants.StandardFonts.HELVETICA standard font with iText.IO.Font.PdfEncodings.WINANSI encoding. More...
 
static PdfFont  CreateFont (PdfDictionary fontDictionary)
  Creates a PdfFont by already existing font dictionary. More...
 
static PdfFont  CreateFont (String fontProgram, String encoding, PdfDocument cacheTo)
  Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument. More...
 
static PdfFont  CreateFont (String fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, PdfDocument cacheTo)
  Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument. More...
 
static PdfFont  CreateFont (String fontProgram)
  Creates a PdfFont instance by the path of the font program file More...
 
static PdfFont  CreateFont (String fontProgram, String encoding)
  Creates a PdfFont instance by the path of the font program file and given encoding. More...
 
static PdfFont  CreateFont (String fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Created a PdfFont instance given the path to the font file. More...
 
static PdfFont  CreateFont (String fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Created a PdfFont instance given the path to the font file. More...
 
static PdfFont  CreateFont (String fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, bool cached)
  Created a PdfFont instance given the path to the font file. More...
 
static PdfFont  CreateFont (FontProgram fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance. More...
 
static PdfFont  CreateFont (FontProgram fontProgram, String encoding)
  Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance. More...
 
static PdfFont  CreateFont (FontProgram fontProgram)
  Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance. More...
 
static PdfFont  CreateFont (byte[] fontProgram, String encoding)
  Created a PdfFont instance by the bytes of the underlying font program. More...
 
static PdfFont  CreateFont (byte[] fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Created a PdfFont instance by the bytes of the underlying font program. More...
 
static PdfFont  CreateFont (byte[] fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Created a PdfFont instance by the bytes of the underlying font program. More...
 
static PdfFont  CreateFont (byte[] fontProgram, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, bool cached)
  Created a PdfFont instance by the bytes of the underlying font program. More...
 
static PdfFont  CreateTtcFont (byte[] ttc, int ttcIndex, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, bool cached)
  Creates a PdfFont instance from the TrueType Collection represented by its byte contents. More...
 
static PdfFont  CreateTtcFont (String ttc, int ttcIndex, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, bool cached)
  Creates a PdfFont instance from the TrueType Collection given by the path to the .ttc file. More...
 
static PdfType3Font  CreateType3Font (PdfDocument document, bool colorized)
  Creates a new instance of PdfType3Font More...
 
static PdfType3Font  CreateType3Font (PdfDocument document, String fontName, String fontFamily, bool colorized)
  Creates a new instance of PdfType3Font More...
 
static PdfFont  CreateRegisteredFont (String fontName, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style, bool cached)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static PdfFont  CreateRegisteredFont (String fontName, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, bool cached)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static PdfFont  CreateRegisteredFont (String fontName, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static PdfFont  CreateRegisteredFont (String fontName, String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static PdfFont  CreateRegisteredFont (String fontName, String encoding)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static PdfFont  CreateRegisteredFont (String fontName)
  Creates PdfFont based on registered iText.IO.Font.FontProgram 's. More...
 
static void  RegisterFamily (String familyName, String fullName, String path)
  Register a font by giving explicitly the font family and name. More...
 
static void  Register (String path)
  Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. More...
 
static void  Register (String path, String alias)
  Register a font file and use an alias for the font contained in it. More...
 
static int  RegisterDirectory (String dirPath)
  Registers all the fonts in a directory. More...
 
static int  RegisterSystemDirectories ()
  Register fonts in some probable directories. More...
 
static ICollection< String >  GetRegisteredFonts ()
  Gets a set of registered font names. More...
 
static ICollection< String >  GetRegisteredFamilies ()
  Gets a set of registered font families. More...
 
static bool  IsRegistered (String fontName)
  Checks if a certain font is registered. More...
 

Detailed Description

This class provides helpful methods for creating fonts ready to be used in a iText.Kernel.Pdf.PdfDocument

This class provides helpful methods for creating fonts ready to be used in a iText.Kernel.Pdf.PdfDocument

Note, just created PdfFont is almost empty until it will be flushed, because it is impossible to fulfill font data until flush.

Member Enumeration Documentation

◆ EmbeddingStrategy

Enum values for font embedding strategies.

Enumerator
FORCE_EMBEDDED 

Force embedding fonts.

Force embedding fonts. It expected to get an exception if the font cannot be embedded.

FORCE_NOT_EMBEDDED 

Force not embedding fonts.

Force not embedding fonts. It is expected to get an exception if the font cannot be not embedded.

PREFER_EMBEDDED 

Embedding fonts if possible.

PREFER_NOT_EMBEDDED 

Not embedding fonts if possible.

Member Function Documentation

◆ CreateFont() [1/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( )
inlinestatic

Creates a new instance of default font, namely iText.IO.Font.Constants.StandardFonts.HELVETICA standard font with iText.IO.Font.PdfEncodings.WINANSI encoding.

Creates a new instance of default font, namely iText.IO.Font.Constants.StandardFonts.HELVETICA standard font with iText.IO.Font.PdfEncodings.WINANSI encoding. Note, if you want to reuse the same instance of default font, you may use iText.Kernel.Pdf.PdfDocument.GetDefaultFont().

Returns
created font

◆ CreateFont() [2/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( byte[]  fontProgram,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Created a PdfFont instance by the bytes of the underlying font program.

Parameters
fontProgram the bytes of the underlying font program
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
Returns
created PdfFont instance

◆ CreateFont() [3/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( byte[]  fontProgram,
String  encoding 
)
inlinestatic

Created a PdfFont instance by the bytes of the underlying font program.

Parameters
fontProgram the bytes of the underlying font program
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
Returns
created PdfFont instance

◆ CreateFont() [4/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( byte[]  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Created a PdfFont instance by the bytes of the underlying font program.

Parameters
fontProgram the bytes of the underlying font program
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
Returns
created PdfFont instance

◆ CreateFont() [5/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( byte[]  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
bool  cached 
)
inlinestatic

Created a PdfFont instance by the bytes of the underlying font program.

Parameters
fontProgram the bytes of the underlying font program
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
cached indicates whether the font will be cached
Returns
created PdfFont instance

◆ CreateFont() [6/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( FontProgram  fontProgram )
inlinestatic

Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.

Parameters
fontProgram the font program of the PdfFont instance to be created
Returns
created PdfFont instance

◆ CreateFont() [7/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( FontProgram  fontProgram,
String  encoding 
)
inlinestatic

Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.

Parameters
fontProgram the font program of the PdfFont instance to be created
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
Returns
created PdfFont instance

◆ CreateFont() [8/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( FontProgram  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.

Parameters
fontProgram the font program of the PdfFont instance to be created
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
Returns
created PdfFont instance

◆ CreateFont() [9/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( PdfDictionary  fontDictionary )
inlinestatic

Creates a PdfFont by already existing font dictionary.

Creates a PdfFont by already existing font dictionary.

Note, the font won't be added to any document, until you add it to iText.Kernel.Pdf.Canvas.PdfCanvas. While adding to iText.Kernel.Pdf.Canvas.PdfCanvas , or to iText.Kernel.Pdf.PdfResources the font will be made indirect implicitly.

iText.Kernel.Pdf.PdfDocument.GetFont(iText.Kernel.Pdf.PdfDictionary) method is strongly recommended if you want to get PdfFont by both existing font dictionary, or just created and hasn't flushed yet.

Parameters
fontDictionary the font dictionary to create the font from
Returns
created PdfFont instance

◆ CreateFont() [10/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram )
inlinestatic

Creates a PdfFont instance by the path of the font program file

Parameters
fontProgram the path of the font program file
Returns
created PdfFont instance

◆ CreateFont() [11/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Created a PdfFont instance given the path to the font file.

Parameters
fontProgram the font program file
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
Returns
created PdfFont instance

◆ CreateFont() [12/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
String  encoding 
)
inlinestatic

Creates a PdfFont instance by the path of the font program file and given encoding.

Parameters
fontProgram the path of the font program file
encoding the font encoding. See iText.IO.Font.PdfEncodings
Returns
created PdfFont instance

◆ CreateFont() [13/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
String  encoding,
PdfDocument  cacheTo 
)
inlinestatic

Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument.

Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument . If such PdfFont has already been created and placed inside the iText.Kernel.Pdf.PdfDocument , then retries its instance instead of creating. EmbeddingStrategy.PREFER_EMBEDDED will be used as embedding strategy.

Parameters
fontProgram the path of the font program file
encoding the font encoding. See iText.IO.Font.PdfEncodings
cacheTo the iText.Kernel.Pdf.PdfDocument to cache the font
Returns
created PdfFont instance

◆ CreateFont() [14/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Created a PdfFont instance given the path to the font file.

Parameters
fontProgram the font program file
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
Returns
created PdfFont instance

◆ CreateFont() [15/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
bool  cached 
)
inlinestatic

Created a PdfFont instance given the path to the font file.

Parameters
fontProgram the font program file
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
cached indicates whether the font will be cached
Returns
created PdfFont instance

◆ CreateFont() [16/16]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateFont ( String  fontProgram,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
PdfDocument  cacheTo 
)
inlinestatic

Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument.

Creates a PdfFont instance by the path of the font program file and given encoding and place it inside the iText.Kernel.Pdf.PdfDocument . If such PdfFont has already been created and placed inside the iText.Kernel.Pdf.PdfDocument , then retries its instance instead of creating.

Parameters
fontProgram the path of the font program file
encoding the font encoding. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
cacheTo the iText.Kernel.Pdf.PdfDocument to cache the font
Returns
created PdfFont instance

◆ CreateRegisteredFont() [1/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName )
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateRegisteredFont() [2/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName,
String  encoding 
)
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
encoding Font encoding from iText.IO.Font.PdfEncodings.
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateRegisteredFont() [3/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy 
)
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
encoding Font encoding from iText.IO.Font.PdfEncodings.
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded. Note, standard font won't be embedded in any case.
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateRegisteredFont() [4/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
bool  cached 
)
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
encoding Font encoding from iText.IO.Font.PdfEncodings.
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded. Note, standard font won't be embedded in any case.
cached If true font will be cached for another PdfDocument
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateRegisteredFont() [5/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
int  style 
)
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
encoding Font encoding from iText.IO.Font.PdfEncodings.
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded. Note, standard font won't be embedded in any case.
style Font style from iText.IO.Font.Constants.FontStyles.
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateRegisteredFont() [6/6]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateRegisteredFont ( String  fontName,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
int  style,
bool  cached 
)
inlinestatic

Creates PdfFont based on registered iText.IO.Font.FontProgram 's.

Creates PdfFont based on registered iText.IO.Font.FontProgram 's. Required font program is expected to be previously registered by one of the register method from PdfFontFactory.

Parameters
fontName Path to font file or Standard font name
encoding Font encoding from iText.IO.Font.PdfEncodings.
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded. Note, standard font won't be embedded in any case.
style Font style from iText.IO.Font.Constants.FontStyles.
cached If true font will be cached for another PdfDocument
Returns
created font if required iText.IO.Font.FontProgram was found among registered, otherwise null.
See also
Register(System.String), Register(System.String, System.String), RegisterFamily(System.String, System.String, System.String), RegisterDirectory(System.String), RegisterSystemDirectories(), GetRegisteredFamilies(), GetRegisteredFonts()

◆ CreateTtcFont() [1/2]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateTtcFont ( byte[]  ttc,
int  ttcIndex,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
bool  cached 
)
inlinestatic

Creates a PdfFont instance from the TrueType Collection represented by its byte contents.

Parameters
ttc the byte contents of the TrueType Collection
ttcIndex the index of the font in the collection, zero-based
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
cached indicates whether the font will be cached
Returns
created PdfFont instance

◆ CreateTtcFont() [2/2]

static PdfFont iText.Kernel.Font.PdfFontFactory.CreateTtcFont ( String  ttc,
int  ttcIndex,
String  encoding,
PdfFontFactory.EmbeddingStrategy  embeddingStrategy,
bool  cached 
)
inlinestatic

Creates a PdfFont instance from the TrueType Collection given by the path to the .ttc file.

Parameters
ttc the path of the .ttc file
ttcIndex the index of the font in the collection, zero-based
encoding the encoding of the font to be created. See iText.IO.Font.PdfEncodings
embeddingStrategy the EmbeddingStrategy which will define whether the font will be embedded
cached indicates whether the font will be cached
Returns
created PdfFont instance

◆ CreateType3Font() [1/2]

static PdfType3Font iText.Kernel.Font.PdfFontFactory.CreateType3Font ( PdfDocument  document,
bool  colorized 
)
inlinestatic

Creates a new instance of PdfType3Font

Parameters
document the target document of the new font
colorized indicates whether the font will be colorized
Returns
created font

◆ CreateType3Font() [2/2]

static PdfType3Font iText.Kernel.Font.PdfFontFactory.CreateType3Font ( PdfDocument  document,
String  fontName,
String  fontFamily,
bool  colorized 
)
inlinestatic

Creates a new instance of PdfType3Font

Parameters
document the target document of the new font.
fontName the PostScript name of the font, shall not be null or empty.
fontFamily a preferred font family name.
colorized indicates whether the font will be colorized
Returns
created font.

◆ GetRegisteredFamilies()

static ICollection iText.Kernel.Font.PdfFontFactory.GetRegisteredFamilies ( )
inlinestatic

Gets a set of registered font families.

Returns
a set of registered font families

◆ GetRegisteredFonts()

static ICollection iText.Kernel.Font.PdfFontFactory.GetRegisteredFonts ( )
inlinestatic

Gets a set of registered font names.

Returns
a set of registered fonts

◆ IsRegistered()

static bool iText.Kernel.Font.PdfFontFactory.IsRegistered ( String  fontName )
inlinestatic

Checks if a certain font is registered.

Parameters
fontName the name of the font that has to be checked.
Returns
true if the font is found, false otherwise

◆ Register() [1/2]

static void iText.Kernel.Font.PdfFontFactory.Register ( String  path )
inlinestatic

Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file.

Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file. In case if TrueType Collection (.ttc), an additional parameter may be specified defining the index of the font to be registered, e.g. "path/to/font/collection.ttc,0". The index is zero-based.

Parameters
path the path to a font file

◆ Register() [2/2]

static void iText.Kernel.Font.PdfFontFactory.Register ( String  path,
String  alias 
)
inlinestatic

Register a font file and use an alias for the font contained in it.

Parameters
path the path to a font file
alias the alias you want to use for the font

◆ RegisterDirectory()

static int iText.Kernel.Font.PdfFontFactory.RegisterDirectory ( String  dirPath )
inlinestatic

Registers all the fonts in a directory.

Parameters
dirPath the directory path to be registered as a font directory path
Returns
the number of fonts registered

◆ RegisterFamily()

static void iText.Kernel.Font.PdfFontFactory.RegisterFamily ( String  familyName,
String  fullName,
String  path 
)
inlinestatic

Register a font by giving explicitly the font family and name.

Parameters
familyName the font family
fullName the font name
path the font path

◆ RegisterSystemDirectories()

static int iText.Kernel.Font.PdfFontFactory.RegisterSystemDirectories ( )
inlinestatic

Register fonts in some probable directories.

Register fonts in some probable directories. It usually works in Windows, Linux and Solaris.

Returns
the number of fonts registered