Class FontFileFinder

java.lang.Object
org.apache.fontbox.util.autodetect.FontFileFinder

public class FontFileFinder extends Object
Helps to autodetect/locate available operating system fonts. This class is based on a class provided by Apache FOP. see org.apache.fop.fonts.autodetect.FontFileFinder
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • fontDirFinder

      private FontDirFinder fontDirFinder
  • Constructor Details

    • FontFileFinder

      public FontFileFinder()
      Default constructor.
  • Method Details

    • determineDirFinder

      private FontDirFinder determineDirFinder()
    • find

      public List<URI> find()
      Automagically finds a list of font files on local system.
      Returns:
      List<URI> of font files
    • find

      public List<URI> find(String dir)
      Searches a given directory for font files.
      Parameters:
      dir - directory to search
      Returns:
      list<URI> of font files
    • walk

      private void walk(File directory, List<URI> results)
      walk down the directory tree and search for font files.
      Parameters:
      directory - the directory to start at
      results - names of all found font files
    • checkFontfile

      private boolean checkFontfile(File file)
      Check if the given name belongs to a font file.
      Parameters:
      file - the given file
      Returns:
      true if the given filename has a typical font file ending