Package org.apache.pdfbox.pdmodel.font
Class FileSystemFontProvider
java.lang.Object
org.apache.pdfbox.pdmodel.font.FontProvider
org.apache.pdfbox.pdmodel.font.FileSystemFontProvider
A FontProvider which searches for fonts on the local filesystem.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static final class
Represents ignored fonts (i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FontCache
private final List<FileSystemFontProvider.FSFontInfo>
private static final org.apache.commons.logging.Log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addTrueTypeCollection
(File ttcFile) Adds a TTC or OTC to the file cache.private void
addTrueTypeFont
(File ttfFile) Adds an OTF or TTF font to the file cache.private void
addTrueTypeFontImpl
(TrueTypeFont ttf, File file) Adds an OTF or TTF font to the file cache.private void
addType1Font
(File pfbFile) Adds a Type 1 font to the file cache.private File
Returns a list of information about fonts on the system.private List<FileSystemFontProvider.FSFontInfo>
loadDiskCache
(List<File> files) Loads the font metadata cache from disk.private void
Saves the font metadata cache to disk.private void
Returns a string containing debugging information.
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
fontInfoList
-
cache
-
-
Constructor Details
-
FileSystemFontProvider
FileSystemFontProvider(FontCache cache) Constructor.
-
-
Method Details
-
scanFonts
-
getDiskCacheFile
-
saveDiskCache
private void saveDiskCache()Saves the font metadata cache to disk. -
loadDiskCache
Loads the font metadata cache from disk. -
addTrueTypeCollection
Adds a TTC or OTC to the file cache. To reduce memory, the parsed font is not cached.- Throws:
IOException
-
addTrueTypeFont
Adds an OTF or TTF font to the file cache. To reduce memory, the parsed font is not cached.- Throws:
IOException
-
addTrueTypeFontImpl
Adds an OTF or TTF font to the file cache. To reduce memory, the parsed font is not cached.- Throws:
IOException
-
addType1Font
Adds a Type 1 font to the file cache. To reduce memory, the parsed font is not cached.- Throws:
IOException
-
toDebugString
Description copied from class:FontProvider
Returns a string containing debugging information. This will be written to the log if no suitable fonts are found and no fallback fonts are available. May be null.- Specified by:
toDebugString
in classFontProvider
-
getFontInfo
Description copied from class:FontProvider
Returns a list of information about fonts on the system.- Specified by:
getFontInfo
in classFontProvider
-