public abstract class AbstractFontFileRegistry extends Object implements FontRegistry
Modifier | Constructor and Description |
---|---|
protected |
AbstractFontFileRegistry() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
addFont(File font,
String encoding)
Adds the fontname by creating the basefont object.
|
protected DefaultFontFamily |
createFamily(String name) |
protected File |
createStorageLocation() |
String[] |
getAllRegisteredFamilies() |
protected String |
getCacheFileName() |
protected String |
getDefaultEncoding() |
protected abstract FileFilter |
getFileFilter() |
FontFamily |
getFontFamily(String name)
Tries to find a font family with the given name, looking through all alternative font names if neccessary.
|
String[] |
getRegisteredFamilies() |
protected HashMap<String,FontFileRecord> |
getSeenFiles() |
void |
initialize() |
protected boolean |
isCached(File file) |
protected boolean |
isCacheValid(HashMap cachedSeenFiles) |
protected void |
loadFromCache(String encoding) |
protected void |
loadFromCache(String encoding,
String filename) |
protected void |
populateFromCache(HashMap<String,DefaultFontFamily> cachedFontFamilies,
HashMap<String,DefaultFontFamily> cachedFullFontNames,
HashMap<String,DefaultFontFamily> cachedAlternateNames) |
protected void |
registerAlternativeName(String name,
DefaultFontFamily family) |
void |
registerDefaultFontPath()
Register os-specific font paths to the PDF-FontFactory.
|
void |
registerFontFile(File file,
String encoding) |
void |
registerFontFile(String filename,
String encoding)
Register the font (must end this *.ttf) to the FontFactory.
|
void |
registerFontPath(File file,
String encoding)
Register all fonts (*.ttf files) in the given path.
|
protected void |
registerFullName(String name,
DefaultFontFamily family) |
protected void |
registerPrimaryName(String name,
DefaultFontFamily family) |
protected String |
safeSystemGetProperty(String name,
String defaultValue) |
protected void |
storeToCache(String encoding) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createMetricsFactory, getSecondLevelCache
protected HashMap<String,FontFileRecord> getSeenFiles()
protected abstract FileFilter getFileFilter()
public void initialize()
initialize
in interface FontRegistry
protected String getDefaultEncoding()
public void registerDefaultFontPath()
protected void registerPrimaryName(String name, DefaultFontFamily family)
protected void registerAlternativeName(String name, DefaultFontFamily family)
protected void registerFullName(String name, DefaultFontFamily family)
protected DefaultFontFamily createFamily(String name)
public String[] getRegisteredFamilies()
getRegisteredFamilies
in interface FontRegistry
public String[] getAllRegisteredFamilies()
getAllRegisteredFamilies
in interface FontRegistry
public FontFamily getFontFamily(String name)
FontRegistry
getFontFamily
in interface FontRegistry
protected void loadFromCache(String encoding)
protected void populateFromCache(HashMap<String,DefaultFontFamily> cachedFontFamilies, HashMap<String,DefaultFontFamily> cachedFullFontNames, HashMap<String,DefaultFontFamily> cachedAlternateNames)
protected String getCacheFileName()
protected void storeToCache(String encoding)
public void registerFontPath(File file, String encoding)
file
- the directory that contains the font files.encoding
- the encoding for the given font.protected boolean isCached(File file)
public void registerFontFile(String filename, String encoding)
filename
- the filename.encoding
- the encoding.protected abstract boolean addFont(File font, String encoding) throws IOException
font
- the font file name.encoding
- the encoding.IOException
- if the base font file could not be read.protected boolean isCacheValid(HashMap cachedSeenFiles)
protected File createStorageLocation()
Copyright © 2018 Hitachi Vantara. All rights reserved.