Class FileSystemFontProvider

java.lang.Object
org.apache.pdfbox.pdmodel.font.FontProvider
org.apache.pdfbox.pdmodel.font.FileSystemFontProvider

final class FileSystemFontProvider extends FontProvider
A FontProvider which searches for fonts on the local filesystem.
  • Field Details

  • Constructor Details

    • FileSystemFontProvider

      FileSystemFontProvider(FontCache cache)
      Constructor.
  • Method Details

    • scanFonts

      private void scanFonts(List<File> files)
    • getDiskCacheFile

      private File getDiskCacheFile()
    • isBadPath

      private static boolean isBadPath(String path)
    • saveDiskCache

      private void saveDiskCache()
      Saves the font metadata cache to disk.
    • loadDiskCache

      private List<FileSystemFontProvider.FSFontInfo> loadDiskCache(List<File> files)
      Loads the font metadata cache from disk.
    • addTrueTypeCollection

      private void addTrueTypeCollection(File ttcFile) throws IOException
      Adds a TTC or OTC to the file cache. To reduce memory, the parsed font is not cached.
      Throws:
      IOException
    • addTrueTypeFont

      private void addTrueTypeFont(File ttfFile) throws IOException
      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(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

      private void addType1Font(File pfbFile) throws IOException
      Adds a Type 1 font to the file cache. To reduce memory, the parsed font is not cached.
      Throws:
      IOException
    • toDebugString

      public String 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 class FontProvider
    • getFontInfo

      public List<? extends FontInfo> getFontInfo()
      Description copied from class: FontProvider
      Returns a list of information about fonts on the system.
      Specified by:
      getFontInfo in class FontProvider