|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.ri.util.FontPropertiesManager
public class FontPropertiesManager
This class provides a very basic Font Properties Management system. When this class is initiated, the properites file "pdfviewerfontcache.properties" is read from the default application file path. If the file cannot be found then all system fonts are read from the operating system and are written to the "pdfviewerfontcache.properties" file.
This class is designed to speed up the load time of the viewer application by reading already parsed font information from the properties file. If new fonts are added to the system, the "pdfviewerfontcache.properties" file can be deleted to trigger this class to re-read the System fonts and re-create a new "pdfviewerfontcache.properties" properites file. // read/store the font cache. ResourceBundle messageBundle = ResourceBundle.getBundle( PropertiesManager.DEFAULT_MESSAGE_BUNDLE); PropertiesManager properties = new PropertiesManager(System.getProperties(), ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE)); new FontPropertiesManager(properties, System.getProperties(), messageBundle);
| Constructor Summary | |
|---|---|
FontPropertiesManager(PropertiesManager appProps,
java.util.Properties sysProps,
java.util.ResourceBundle messageBundle)
Create a new instance of the FontPropertiesManager class. |
|
FontPropertiesManager(PropertiesManager appProps,
java.util.ResourceBundle messageBundle)
Create a new instance of the FontPropertiesManager class. |
|
| Method Summary | |
|---|---|
void |
clearProperties()
Clears any font references from the font managers internal cache. |
boolean |
getBoolean(java.lang.String propertyName,
boolean defaultValue)
|
boolean |
loadProperties()
Loads the properties file and loads any font data that it contains. |
boolean |
readDefaulFontPaths(java.lang.String[] extraFontPaths)
Sets the default font properties files by readying available system font paths. |
void |
readFontPaths(java.lang.String[] fontPaths)
Reads the specified file paths and loads any found font fonts in the font Manager. |
void |
removeFontCacheFile()
Removes the the properties file from the file system. |
void |
saveProperties()
Touches the properties file, writing out any font properties. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FontPropertiesManager(PropertiesManager appProps,
java.util.Properties sysProps,
java.util.ResourceBundle messageBundle)
appProps - properties manager referencesysProps - system properties.messageBundle - application message bundle.
public FontPropertiesManager(PropertiesManager appProps,
java.util.ResourceBundle messageBundle)
readFontPaths(java.lang.String[]) or readDefaulFontPaths(String[])
Typical usage would look like this:
appProps - properties manager referencemessageBundle - application message bundle.| Method Detail |
|---|
public void removeFontCacheFile()
public void clearProperties()
public boolean loadProperties()
public void readFontPaths(java.lang.String[] fontPaths)
saveProperties() needs to be called.
fontPaths - array of paths containing folderspublic void saveProperties()
public boolean readDefaulFontPaths(java.lang.String[] extraFontPaths)
extraFontPaths - extra font paths to load on top of the default paths.
public boolean getBoolean(java.lang.String propertyName,
boolean defaultValue)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||