Package com.itextpdf.kernel.font
Class PdfFontFactory
- java.lang.Object
-
- com.itextpdf.kernel.font.PdfFontFactory
-
public final class PdfFontFactory extends java.lang.ObjectThis class provides helpful methods for creating fonts ready to be used in aPdfDocumentNote, just created
PdfFontis almost empty until it will be flushed, because it is impossible to fulfill font data until flush.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdfFontFactory.EmbeddingStrategyEnum values for font embedding strategies.
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEFAULT_CACHEDThis is the default value of the cached variable.private static PdfFontFactory.EmbeddingStrategyDEFAULT_EMBEDDINGThis is the default value of the embeddedStrategy variable.private static java.lang.StringDEFAULT_ENCODINGThis is the default encoding to use.
-
Constructor Summary
Constructors Constructor Description PdfFontFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PdfFontcreateFont()Creates a new instance of default font, namelyStandardFonts.HELVETICAstandard font withPdfEncodings.WINANSIencoding.static PdfFontcreateFont(byte[] fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)Created aPdfFontinstance by the bytes of the underlying font program.static PdfFontcreateFont(byte[] fontProgram, java.lang.String encoding)Created aPdfFontinstance by the bytes of the underlying font program.static PdfFontcreateFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)Created aPdfFontinstance by the bytes of the underlying font program.static PdfFontcreateFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)Created aPdfFontinstance by the bytes of the underlying font program.static PdfFontcreateFont(FontProgram fontProgram)Created aPdfFontinstance given the given underlyingFontPrograminstance.static PdfFontcreateFont(FontProgram fontProgram, java.lang.String encoding)Created aPdfFontinstance given the given underlyingFontPrograminstance.static PdfFontcreateFont(FontProgram fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)Created aPdfFontinstance given the given underlyingFontPrograminstance.static PdfFontcreateFont(PdfDictionary fontDictionary)Creates aPdfFontby already existing font dictionary.static PdfFontcreateFont(java.lang.String fontProgram)Creates aPdfFontinstance by the path of the font program filestatic PdfFontcreateFont(java.lang.String fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)Created aPdfFontinstance given the path to the font file.static PdfFontcreateFont(java.lang.String fontProgram, java.lang.String encoding)Creates aPdfFontinstance by the path of the font program file and given encoding.static PdfFontcreateFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)Created aPdfFontinstance given the path to the font file.static PdfFontcreateFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)Created aPdfFontinstance given the path to the font file.static PdfFontcreateFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, PdfDocument cacheTo)Creates aPdfFontinstance by the path of the font program file and given encoding and place it inside thePdfDocument.static PdfFontcreateFont(java.lang.String fontProgram, java.lang.String encoding, PdfDocument cacheTo)Creates aPdfFontinstance by the path of the font program file and given encoding and place it inside thePdfDocument.private static PdfType1FontcreateFontFromType1FontProgram(Type1Font fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)static PdfFontcreateRegisteredFont(java.lang.String fontName)CreatesPdfFontbased on registeredFontProgram's.static PdfFontcreateRegisteredFont(java.lang.String fontName, java.lang.String encoding)CreatesPdfFontbased on registeredFontProgram's.static PdfFontcreateRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)CreatesPdfFontbased on registeredFontProgram's.static PdfFontcreateRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)CreatesPdfFontbased on registeredFontProgram's.static PdfFontcreateRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style)CreatesPdfFontbased on registeredFontProgram's.static PdfFontcreateRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style, boolean cached)CreatesPdfFontbased on registeredFontProgram's.private static PdfTrueTypeFontcreateTrueTypeFontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)static PdfFontcreateTtcFont(byte[] ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)Creates aPdfFontinstance from the TrueType Collection represented by its byte contents.static PdfFontcreateTtcFont(java.lang.String ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)Creates aPdfFontinstance from the TrueType Collection given by the path to the .ttc file.private static PdfType0FontcreateType0FontFromCidFontProgram(CidFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)private static PdfType0FontcreateType0FontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)static PdfType3FontcreateType3Font(PdfDocument document, boolean colorized)Creates a new instance ofPdfType3Fontstatic PdfType3FontcreateType3Font(PdfDocument document, java.lang.String fontName, java.lang.String fontFamily, boolean colorized)Creates a new instance ofPdfType3Fontstatic java.util.Set<java.lang.String>getRegisteredFamilies()Gets a set of registered font families.static java.util.Set<java.lang.String>getRegisteredFonts()Gets a set of registered font names.static booleanisRegistered(java.lang.String fontName)Checks if a certain font is registered.static voidregister(java.lang.String path)Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file.static voidregister(java.lang.String path, java.lang.String alias)Register a font file and use an alias for the font contained in it.static intregisterDirectory(java.lang.String dirPath)Registers all the fonts in a directory.static intregisterDirectoryRecursively(java.lang.String dirPath)Registers all the fonts in a directory recursively.static voidregisterFamily(java.lang.String familyName, java.lang.String fullName, java.lang.String path)Register a font by giving explicitly the font family and name.static intregisterSystemDirectories()Register fonts in some probable directories.
-
-
-
Field Detail
-
DEFAULT_ENCODING
private static final java.lang.String DEFAULT_ENCODING
This is the default encoding to use.- See Also:
- Constant Field Values
-
DEFAULT_EMBEDDING
private static final PdfFontFactory.EmbeddingStrategy DEFAULT_EMBEDDING
This is the default value of the embeddedStrategy variable.
-
DEFAULT_CACHED
private static final boolean DEFAULT_CACHED
This is the default value of the cached variable.- See Also:
- Constant Field Values
-
-
Method Detail
-
createFont
public static PdfFont createFont() throws java.io.IOException
Creates a new instance of default font, namelyStandardFonts.HELVETICAstandard font withPdfEncodings.WINANSIencoding. Note, if you want to reuse the same instance of default font, you may usePdfDocument.getDefaultFont().- Returns:
- created font
- Throws:
java.io.IOException- if error occurred while creating the font, e.g. metrics loading failure
-
createFont
public static PdfFont createFont(PdfDictionary fontDictionary)
Creates aPdfFontby already existing font dictionary.Note, the font won't be added to any document, until you add it to
PdfCanvas. While adding toPdfCanvas, or toPdfResourcesthe font will be made indirect implicitly.PdfDocument.getFont(com.itextpdf.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
PdfFontinstance
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding, PdfDocument cacheTo) throws java.io.IOException
Creates aPdfFontinstance by the path of the font program file and given encoding and place it inside thePdfDocument. If suchPdfFonthas already been created and placed inside thePdfDocument, then retries its instance instead of creating.PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDEDwill be used as embedding strategy.- Parameters:
fontProgram- the path of the font program fileencoding- the font encoding. SeePdfEncodingscacheTo- thePdfDocumentto cache the font- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, PdfDocument cacheTo) throws java.io.IOException
Creates aPdfFontinstance by the path of the font program file and given encoding and place it inside thePdfDocument. If suchPdfFonthas already been created and placed inside thePdfDocument, then retries its instance instead of creating.- Parameters:
fontProgram- the path of the font program fileencoding- the font encoding. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embeddedcacheTo- thePdfDocumentto cache the font- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file
-
createFont
public static PdfFont createFont(java.lang.String fontProgram) throws java.io.IOException
Creates aPdfFontinstance by the path of the font program file- Parameters:
fontProgram- the path of the font program file- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding) throws java.io.IOException
Creates aPdfFontinstance by the path of the font program file and given encoding.- Parameters:
fontProgram- the path of the font program fileencoding- the font encoding. SeePdfEncodings- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
Created aPdfFontinstance given the path to the font file.- Parameters:
fontProgram- the font program fileembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- in case the file is not found or the contents of the font file is mal-formed
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
Created aPdfFontinstance given the path to the font file.- Parameters:
fontProgram- the font program fileencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- in case the file is not found or the contents of the font file is mal-formed
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached) throws java.io.IOException
Created aPdfFontinstance given the path to the font file.- Parameters:
fontProgram- the font program fileencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embeddedcached- indicates whether the font will be cached- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- in case the file is not found or the contents of the font file is mal-formed
-
createFont
public static PdfFont createFont(FontProgram fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFontinstance given the given underlyingFontPrograminstance.- Parameters:
fontProgram- the font program of thePdfFontinstance to be createdencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded- Returns:
- created
PdfFontinstance
-
createFont
public static PdfFont createFont(FontProgram fontProgram, java.lang.String encoding)
Created aPdfFontinstance given the given underlyingFontPrograminstance.- Parameters:
fontProgram- the font program of thePdfFontinstance to be createdencoding- the encoding of the font to be created. SeePdfEncodings- Returns:
- created
PdfFontinstance
-
createFont
public static PdfFont createFont(FontProgram fontProgram)
Created aPdfFontinstance given the given underlyingFontPrograminstance.
-
createFont
public static PdfFont createFont(byte[] fontProgram, java.lang.String encoding) throws java.io.IOException
Created aPdfFontinstance by the bytes of the underlying font program.- Parameters:
fontProgram- the bytes of the underlying font programencoding- the encoding of the font to be created. SeePdfEncodings- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- signals that an I/O exception has occurred.
-
createFont
public static PdfFont createFont(byte[] fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
Created aPdfFontinstance by the bytes of the underlying font program.- Parameters:
fontProgram- the bytes of the underlying font programembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- signals that an I/O exception has occurred.
-
createFont
public static PdfFont createFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
Created aPdfFontinstance by the bytes of the underlying font program.- Parameters:
fontProgram- the bytes of the underlying font programencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- signals that an I/O exception has occurred.
-
createFont
public static PdfFont createFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached) throws java.io.IOException
Created aPdfFontinstance by the bytes of the underlying font program.- Parameters:
fontProgram- the bytes of the underlying font programencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embeddedcached- indicates whether the font will be cached- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- signals that an I/O exception has occurred.
-
createTtcFont
public static PdfFont createTtcFont(byte[] ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached) throws java.io.IOException
Creates aPdfFontinstance from the TrueType Collection represented by its byte contents.- Parameters:
ttc- the byte contents of the TrueType CollectionttcIndex- the index of the font in the collection, zero-basedencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embeddedcached- indicates whether the font will be cached- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- in case the contents of the TrueType Collection is mal-formed or an error occurred during reading the font
-
createTtcFont
public static PdfFont createTtcFont(java.lang.String ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached) throws java.io.IOException
Creates aPdfFontinstance from the TrueType Collection given by the path to the .ttc file.- Parameters:
ttc- the path of the .ttc filettcIndex- the index of the font in the collection, zero-basedencoding- the encoding of the font to be created. SeePdfEncodingsembeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embeddedcached- indicates whether the font will be cached- Returns:
- created
PdfFontinstance - Throws:
java.io.IOException- in case the file is not found, contents of the TrueType Collection is mal-formed or an error occurred during reading the font
-
createType3Font
public static PdfType3Font createType3Font(PdfDocument document, boolean colorized)
Creates a new instance ofPdfType3Font- Parameters:
document- the target document of the new fontcolorized- indicates whether the font will be colorized- Returns:
- created font
-
createType3Font
public static PdfType3Font createType3Font(PdfDocument document, java.lang.String fontName, java.lang.String fontFamily, boolean colorized)
Creates a new instance ofPdfType3Font- 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.
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style, boolean cached) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font nameencoding- Font encoding fromPdfEncodings.embeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded. Note, standard font won't be embedded in any case.style- Font style fromFontStyles.cached- If true font will be cached for another PdfDocument- Returns:
- created font if required
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font nameencoding- Font encoding fromPdfEncodings.embeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich 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
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font nameencoding- Font encoding fromPdfEncodings.embeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded. Note, standard font won't be embedded in any case.- Returns:
- created font if required
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font nameencoding- Font encoding fromPdfEncodings.embeddingStrategy- thePdfFontFactory.EmbeddingStrategywhich will define whether the font will be embedded. Note, standard font won't be embedded in any case.style- Font style fromFontStyles.- Returns:
- created font if required
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font nameencoding- Font encoding fromPdfEncodings.- Returns:
- created font if required
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName) throws java.io.IOException
CreatesPdfFontbased on registeredFontProgram's. Required font program is expected to be previously registered by one of the register method fromPdfFontFactory.- Parameters:
fontName- Path to font file or Standard font name- Returns:
- created font if required
FontProgramwas found among registered, otherwise null. - Throws:
java.io.IOException- exception is thrown in case an I/O error occurs when reading the file- See Also:
register(String),register(String, String),registerFamily(String, String, String),registerDirectory(String),registerDirectoryRecursively(String),registerSystemDirectories(),getRegisteredFamilies(),getRegisteredFonts()
-
registerFamily
public static void registerFamily(java.lang.String familyName, java.lang.String fullName, java.lang.String path)Register a font by giving explicitly the font family and name.- Parameters:
familyName- the font familyfullName- the font namepath- the font path
-
register
public static void register(java.lang.String path)
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
public static void register(java.lang.String path, java.lang.String alias)Register a font file and use an alias for the font contained in it.- Parameters:
path- the path to a font filealias- the alias you want to use for the font
-
registerDirectory
public static int registerDirectory(java.lang.String dirPath)
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
-
registerDirectoryRecursively
public static int registerDirectoryRecursively(java.lang.String dirPath)
Registers all the fonts in a directory recursively.- Parameters:
dirPath- the directory path to be registered as a font directory path- Returns:
- the number of fonts registered
-
registerSystemDirectories
public static int registerSystemDirectories()
Register fonts in some probable directories. It usually works in Windows, Linux and Solaris.- Returns:
- the number of fonts registered
-
getRegisteredFonts
public static java.util.Set<java.lang.String> getRegisteredFonts()
Gets a set of registered font names.- Returns:
- a set of registered fonts
-
getRegisteredFamilies
public static java.util.Set<java.lang.String> getRegisteredFamilies()
Gets a set of registered font families.- Returns:
- a set of registered font families
-
isRegistered
public static boolean isRegistered(java.lang.String fontName)
Checks if a certain font is registered.- Parameters:
fontName- the name of the font that has to be checked.- Returns:
trueif the font is found,falseotherwise
-
createFontFromType1FontProgram
private static PdfType1Font createFontFromType1FontProgram(Type1Font fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
-
createType0FontFromTrueTypeFontProgram
private static PdfType0Font createType0FontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
-
createTrueTypeFontFromTrueTypeFontProgram
private static PdfTrueTypeFont createTrueTypeFontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
-
createType0FontFromCidFontProgram
private static PdfType0Font createType0FontFromCidFontProgram(CidFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
-
-