Class FontFileFinder
- java.lang.Object
-
- org.apache.fontbox.util.autodetect.FontFileFinder
-
public class FontFileFinder extends java.lang.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 Summary
Fields Modifier and Type Field Description private FontDirFinder
fontDirFinder
private static org.apache.commons.logging.Log
LOG
-
Constructor Summary
Constructors Constructor Description FontFileFinder()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
checkFontfile(java.io.File file)
Check if the given name belongs to a font file.private FontDirFinder
determineDirFinder()
java.util.List<java.net.URI>
find()
Automagically finds a list of font files on local system.java.util.List<java.net.URI>
find(java.lang.String dir)
Searches a given directory for font files.private void
walk(java.io.File directory, java.util.List<java.net.URI> results)
walk down the directory tree and search for font files.
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
fontDirFinder
private FontDirFinder fontDirFinder
-
-
Method Detail
-
determineDirFinder
private FontDirFinder determineDirFinder()
-
find
public java.util.List<java.net.URI> find()
Automagically finds a list of font files on local system.- Returns:
- List<URI> of font files
-
find
public java.util.List<java.net.URI> find(java.lang.String dir)
Searches a given directory for font files.- Parameters:
dir
- directory to search- Returns:
- list<URI> of font files
-
walk
private void walk(java.io.File directory, java.util.List<java.net.URI> results)
walk down the directory tree and search for font files.- Parameters:
directory
- the directory to start atresults
- names of all found font files
-
checkFontfile
private boolean checkFontfile(java.io.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
-
-