Package com.itextpdf.kernel.font
Class PdfFontFactory
- java.lang.Object
-
- com.itextpdf.kernel.font.PdfFontFactory
-
public final class PdfFontFactory extends java.lang.Object
This class provides helpful methods for creating fonts ready to be used in aPdfDocument
Note, just created
PdfFont
is 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 class
PdfFontFactory.EmbeddingStrategy
Enum values for font embedding strategies.
-
Field Summary
Fields Modifier and Type Field Description private static boolean
DEFAULT_CACHED
This is the default value of the cached variable.private static PdfFontFactory.EmbeddingStrategy
DEFAULT_EMBEDDING
This is the default value of the embeddedStrategy variable.private static java.lang.String
DEFAULT_ENCODING
This 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 PdfFont
createFont()
Creates a new instance of default font, namelyStandardFonts.HELVETICA
standard font withPdfEncodings.WINANSI
encoding.static PdfFont
createFont(byte[] fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFont
instance by the bytes of the underlying font program.static PdfFont
createFont(byte[] fontProgram, java.lang.String encoding)
Created aPdfFont
instance by the bytes of the underlying font program.static PdfFont
createFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFont
instance by the bytes of the underlying font program.static PdfFont
createFont(byte[] fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)
Created aPdfFont
instance by the bytes of the underlying font program.static PdfFont
createFont(FontProgram fontProgram)
Created aPdfFont
instance given the given underlyingFontProgram
instance.static PdfFont
createFont(FontProgram fontProgram, java.lang.String encoding)
Created aPdfFont
instance given the given underlyingFontProgram
instance.static PdfFont
createFont(FontProgram fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFont
instance given the given underlyingFontProgram
instance.static PdfFont
createFont(PdfDictionary fontDictionary)
Creates aPdfFont
by already existing font dictionary.static PdfFont
createFont(java.lang.String fontProgram)
Creates aPdfFont
instance by the path of the font program filestatic PdfFont
createFont(java.lang.String fontProgram, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFont
instance given the path to the font file.static PdfFont
createFont(java.lang.String fontProgram, java.lang.String encoding)
Creates aPdfFont
instance by the path of the font program file and given encoding.static PdfFont
createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
Created aPdfFont
instance given the path to the font file.static PdfFont
createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)
Created aPdfFont
instance given the path to the font file.static PdfFont
createFont(java.lang.String fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, PdfDocument cacheTo)
Creates aPdfFont
instance by the path of the font program file and given encoding and place it inside thePdfDocument
.static PdfFont
createFont(java.lang.String fontProgram, java.lang.String encoding, PdfDocument cacheTo)
Creates aPdfFont
instance by the path of the font program file and given encoding and place it inside thePdfDocument
.private static PdfType1Font
createFontFromType1FontProgram(Type1Font fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
static PdfFont
createRegisteredFont(java.lang.String fontName)
CreatesPdfFont
based on registeredFontProgram
's.static PdfFont
createRegisteredFont(java.lang.String fontName, java.lang.String encoding)
CreatesPdfFont
based on registeredFontProgram
's.static PdfFont
createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
CreatesPdfFont
based on registeredFontProgram
's.static PdfFont
createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)
CreatesPdfFont
based on registeredFontProgram
's.static PdfFont
createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style)
CreatesPdfFont
based on registeredFontProgram
's.static PdfFont
createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, int style, boolean cached)
CreatesPdfFont
based on registeredFontProgram
's.private static PdfTrueTypeFont
createTrueTypeFontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
static PdfFont
createTtcFont(byte[] ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)
Creates aPdfFont
instance from the TrueType Collection represented by its byte contents.static PdfFont
createTtcFont(java.lang.String ttc, int ttcIndex, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy, boolean cached)
Creates aPdfFont
instance from the TrueType Collection given by the path to the .ttc file.private static PdfType0Font
createType0FontFromCidFontProgram(CidFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
private static PdfType0Font
createType0FontFromTrueTypeFontProgram(TrueTypeFont fontProgram, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy)
static PdfType3Font
createType3Font(PdfDocument document, boolean colorized)
Creates a new instance ofPdfType3Font
static PdfType3Font
createType3Font(PdfDocument document, java.lang.String fontName, java.lang.String fontFamily, boolean colorized)
Creates a new instance ofPdfType3Font
static 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 boolean
isRegistered(java.lang.String fontName)
Checks if a certain font is registered.static void
register(java.lang.String path)
Registers a .ttf, .otf, .afm, .pfm, or a .ttc font file.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.static int
registerDirectory(java.lang.String dirPath)
Registers all the fonts in a directory.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.static int
registerSystemDirectories()
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.HELVETICA
standard font withPdfEncodings.WINANSI
encoding. 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 aPdfFont
by already existing font dictionary.Note, the font won't be added to any document, until you add it to
PdfCanvas
. While adding toPdfCanvas
, or toPdfResources
the 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
PdfFont
instance
-
createFont
public static PdfFont createFont(java.lang.String fontProgram, java.lang.String encoding, PdfDocument cacheTo) throws java.io.IOException
Creates aPdfFont
instance by the path of the font program file and given encoding and place it inside thePdfDocument
. If suchPdfFont
has already been created and placed inside thePdfDocument
, then retries its instance instead of creating.PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDED
will be used as embedding strategy.- Parameters:
fontProgram
- the path of the font program fileencoding
- the font encoding. SeePdfEncodings
cacheTo
- thePdfDocument
to cache the font- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance by the path of the font program file and given encoding and place it inside thePdfDocument
. If suchPdfFont
has 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. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embeddedcacheTo
- thePdfDocument
to cache the font- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance by the path of the font program file- Parameters:
fontProgram
- the path of the font program file- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance 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
PdfFont
instance - 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 aPdfFont
instance given the path to the font file.- Parameters:
fontProgram
- the font program fileembeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embedded- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance given the path to the font file.- Parameters:
fontProgram
- the font program fileencoding
- the encoding of the font to be created. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embedded- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance given the path to the font file.- Parameters:
fontProgram
- the font program fileencoding
- the encoding of the font to be created. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embeddedcached
- indicates whether the font will be cached- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance given the given underlyingFontProgram
instance.- Parameters:
fontProgram
- the font program of thePdfFont
instance to be createdencoding
- the encoding of the font to be created. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embedded- Returns:
- created
PdfFont
instance
-
createFont
public static PdfFont createFont(FontProgram fontProgram, java.lang.String encoding)
Created aPdfFont
instance given the given underlyingFontProgram
instance.- Parameters:
fontProgram
- the font program of thePdfFont
instance to be createdencoding
- the encoding of the font to be created. SeePdfEncodings
- Returns:
- created
PdfFont
instance
-
createFont
public static PdfFont createFont(FontProgram fontProgram)
Created aPdfFont
instance given the given underlyingFontProgram
instance.
-
createFont
public static PdfFont createFont(byte[] fontProgram, java.lang.String encoding) throws java.io.IOException
Created aPdfFont
instance 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
PdfFont
instance - 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 aPdfFont
instance by the bytes of the underlying font program.- Parameters:
fontProgram
- the bytes of the underlying font programembeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embedded- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance 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
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embedded- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance 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
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embeddedcached
- indicates whether the font will be cached- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance 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. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embeddedcached
- indicates whether the font will be cached- Returns:
- created
PdfFont
instance - 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 aPdfFont
instance 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. SeePdfEncodings
embeddingStrategy
- thePdfFontFactory.EmbeddingStrategy
which will define whether the font will be embeddedcached
- indicates whether the font will be cached- Returns:
- created
PdfFont
instance - 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
CreatesPdfFont
based 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.EmbeddingStrategy
which 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
FontProgram
was 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)
,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
CreatesPdfFont
based 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.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
FontProgram
was 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)
,registerSystemDirectories()
,getRegisteredFamilies()
,getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding, PdfFontFactory.EmbeddingStrategy embeddingStrategy) throws java.io.IOException
CreatesPdfFont
based 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.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
FontProgram
was 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)
,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
CreatesPdfFont
based 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.EmbeddingStrategy
which 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
FontProgram
was 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)
,registerSystemDirectories()
,getRegisteredFamilies()
,getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName, java.lang.String encoding) throws java.io.IOException
CreatesPdfFont
based 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
FontProgram
was 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)
,registerSystemDirectories()
,getRegisteredFamilies()
,getRegisteredFonts()
-
createRegisteredFont
public static PdfFont createRegisteredFont(java.lang.String fontName) throws java.io.IOException
CreatesPdfFont
based 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
FontProgram
was 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)
,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
-
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:
true
if the font is found,false
otherwise
-
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)
-
-