Class FileSystemFontProvider

java.lang.Object
org.sejda.sambox.pdmodel.font.FontProvider
org.sejda.sambox.pdmodel.font.FileSystemFontProvider

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

  • Constructor Details

    • FileSystemFontProvider

      public FileSystemFontProvider()
  • Method Details

    • findFontFiles

      protected List<File> findFontFiles()
    • initialize

      private void initialize()
    • scanFonts

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

      protected 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(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

      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
    • getFontInfo

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