iText 8.0.2 API
|
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... |
|
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.
Enum values for font embedding strategies.
|
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().
|
inlinestatic |
Created a PdfFont instance by the bytes of the underlying font program.
fontProgram | the bytes of the underlying font program |
embeddingStrategy | the EmbeddingStrategy which will define whether the font will be embedded |
|
inlinestatic |
Created a PdfFont instance by the bytes of the underlying font program.
fontProgram | the bytes of the underlying font program |
encoding | the encoding of the font to be created. See iText.IO.Font.PdfEncodings |
|
inlinestatic |
Created a PdfFont instance by the bytes of the underlying font program.
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 |
|
inlinestatic |
Created a PdfFont instance by the bytes of the underlying font program.
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 |
|
inlinestatic |
Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.
fontProgram | the font program of the PdfFont instance to be created |
|
inlinestatic |
Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.
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 |
|
inlinestatic |
Created a PdfFont instance given the given underlying iText.IO.Font.FontProgram instance.
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 |
|
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.
fontDictionary | the font dictionary to create the font from |
|
inlinestatic |
|
inlinestatic |
Created a PdfFont instance given the path to the font file.
fontProgram | the font program file |
embeddingStrategy | the EmbeddingStrategy which will define whether the font will be embedded |
|
inlinestatic |
Creates a PdfFont instance by the path of the font program file and given encoding.
fontProgram | the path of the font program file |
encoding | the font encoding. See iText.IO.Font.PdfEncodings |
|
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.
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 |
|
inlinestatic |
Created a PdfFont instance given the path to the font file.
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 |
|
inlinestatic |
Created a PdfFont instance given the path to the font file.
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 |
|
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.
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 |
|
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.
fontName | Path to font file or Standard font name |
|
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.
fontName | Path to font file or Standard font name |
encoding | Font encoding from iText.IO.Font.PdfEncodings. |
|
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.
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. |
|
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.
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 |
|
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.
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. |
|
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.
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 |
|
inlinestatic |
Creates a PdfFont instance from the TrueType Collection represented by its byte contents.
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 |
|
inlinestatic |
Creates a PdfFont instance from the TrueType Collection given by the path to the .ttc file.
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 |
|
inlinestatic |
Creates a new instance of PdfType3Font
document | the target document of the new font |
colorized | indicates whether the font will be colorized |
|
inlinestatic |
Creates a new instance of PdfType3Font
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 |
|
inlinestatic |
Gets a set of registered font families.
|
inlinestatic |
Gets a set of registered font names.
|
inlinestatic |
Checks if a certain font is registered.
fontName | the name of the font that has to be checked. |
true
if the font is found, false
otherwise
|
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.
path | the path to a font file |
|
inlinestatic |
Register a font file and use an alias for the font contained in it.
path | the path to a font file |
alias | the alias you want to use for the font |
|
inlinestatic |
Registers all the fonts in a directory.
dirPath | the directory path to be registered as a font directory path |
|
inlinestatic |
Register a font by giving explicitly the font family and name.
familyName | the font family |
fullName | the font name |
path | the font path |
|
inlinestatic |
Register fonts in some probable directories.
Register fonts in some probable directories. It usually works in Windows, Linux and Solaris.