java.lang.Object
org.sejda.sambox.pdmodel.font.FontProvider
org.sejda.sambox.pdmodel.font.FileSystemFontProvider
A FontProvider which searches for fonts on the local filesystem.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static final classRepresents ignored fonts (i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FontCacheprivate static final Stringprivate final List<FileSystemFontProvider.FSFontInfo>private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTrueTypeCollection(File ttcFile) Adds a TTC or OTC to the file cache.private voidaddTrueTypeFont(File ttfFile) Adds an OTF or TTF font to the file cache.private voidaddTrueTypeFontImpl(org.apache.fontbox.ttf.TrueTypeFont ttf, File file) Adds an OTF or TTF font to the file cache.private voidaddType1Font(File pfbFile) Adds a Type 1 font to the file cache.protected Fileprivate voidprivate static booleanprivate List<FileSystemFontProvider.FSFontInfo>loadDiskCache(List<File> files) Loads the font metadata cache from disk.private voidSaves the font metadata cache to disk.private void
-
Field Details
-
FONT_CACHE
-
FONT_CACHE_SEPARATOR
- See Also:
-
LOG
private static final org.slf4j.Logger LOG -
fontInfoList
-
-
Constructor Details
-
FileSystemFontProvider
public FileSystemFontProvider()
-
-
Method Details
-
findFontFiles
-
initialize
private void initialize() -
scanFonts
-
getDiskCacheFile
-
isBadPath
-
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
private void addTrueTypeFontImpl(org.apache.fontbox.ttf.TrueTypeFont ttf, File file) throws IOException 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
-
getFontInfo
- Specified by:
getFontInfoin classFontProvider- Returns:
- a list of information about fonts on the system.
-