Top Description Fields Constructors Methods
org.apache.fontbox.util.autodetect

public Class FontFileFinder

extends Object
Class Inheritance
Imports
java.io.File, java.net.URI, java.util.ArrayList, .List, .Locale, org.apache.commons.logging.Log, .LogFactory

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

Modifier and TypeField and Description
private FontDirFinder
private static final Log

Constructor Summary

AccessConstructor and Description
public
FontFileFinder()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true if the given filename has a typical font file ending
checkFontfile
(File
the given file
file
)

Check if the given name belongs to a font file.

private FontDirFinder
public List<URI>

Returns:

List<URI> of font files
find
()

Automagically finds a list of font files on local system.

public List<URI>

Returns:

list<URI> of font files
find
(String
directory to search
dir
)

Searches a given directory for font files.

private void
walk(File
the directory to start at
directory
,
List<URI>
names of all found font files
results
)

walk down the directory tree and search for font files.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontDirFinderback to summary
private FontDirFinder fontDirFinder
LOGback to summary
private static final Log LOG

Constructor Detail

FontFileFinderback to summary
public FontFileFinder()

Default constructor.

Method Detail

checkFontfileback to summary
private boolean checkFontfile(File file)

Check if the given name belongs to a font file.

Parameters
file:File

the given file

Returns:boolean

true if the given filename has a typical font file ending

determineDirFinderback to summary
private FontDirFinder determineDirFinder()
findback to summary
public List<URI> find()

Automagically finds a list of font files on local system.

Returns:List<URI>

List<URI> of font files

findback to summary
public List<URI> find(String dir)

Searches a given directory for font files.

Parameters
dir:String

directory to search

Returns:List<URI>

list<URI> of font files

walkback to summary
private void walk(File directory, List<URI> results)

walk down the directory tree and search for font files.

Parameters
directory:File

the directory to start at

results:List<URI>

names of all found font files