|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.fonts.FontCache
public final class FontCache
Fop cache (currently only used for font info caching)
Constructor Summary | |
---|---|
FontCache()
Default constructor |
Method Summary | |
---|---|
void |
addFont(EmbedFontInfo fontInfo)
Adds a font info to cache |
void |
clear()
Clears font cache |
boolean |
containsFont(EmbedFontInfo fontInfo)
is this font info in the cache? |
boolean |
containsFont(java.lang.String embedUrl)
is this font in the cache? |
protected static java.lang.String |
getCacheKey(EmbedFontInfo fontInfo)
creates a key given a font info for the font mapping |
static java.io.File |
getDefaultCacheFile(boolean forWriting)
Returns the default font cache file. |
static java.io.File |
getFileFromUrls(java.lang.String[] urls)
Tries to identify a File instance from an array of URLs. |
org.apache.fop.fonts.FontCache.CachedFontFile |
getFontFile(java.lang.String embedUrl)
Returns a font from the cache. |
EmbedFontInfo[] |
getFontInfos(java.lang.String embedUrl,
long lastModified)
Returns the EmbedFontInfo instances belonging to a font file. |
static long |
getLastModified(java.net.URL url)
Retrieve the last modified date/time of a URL. |
boolean |
hasChanged()
cache has been updated since it was read |
boolean |
isFailedFont(java.lang.String embedUrl,
long lastModified)
has this font previously failed to load? |
static FontCache |
load()
Reads the default font cache file and returns its contents. |
static FontCache |
loadFrom(java.io.File cacheFile)
Reads a font cache file and returns its contents. |
void |
registerFailedFont(java.lang.String embedUrl,
long lastModified)
Registers a failed font with the cache |
void |
removeFont(java.lang.String embedUrl)
removes font from cache |
void |
save()
Writes the font cache to disk. |
void |
saveTo(java.io.File cacheFile)
Writes the font cache to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FontCache()
Method Detail |
---|
public static java.io.File getDefaultCacheFile(boolean forWriting)
forWriting
- true if the user directory should be created
public static FontCache load()
public static FontCache loadFrom(java.io.File cacheFile)
cacheFile
- the cache file
public void save() throws FOPException
FOPException
- fop exceptionpublic void saveTo(java.io.File cacheFile) throws FOPException
cacheFile
- the file to write to
FOPException
- fop exceptionprotected static java.lang.String getCacheKey(EmbedFontInfo fontInfo)
fontInfo
- font info
public boolean hasChanged()
public boolean containsFont(java.lang.String embedUrl)
embedUrl
- font info
public boolean containsFont(EmbedFontInfo fontInfo)
fontInfo
- font info
public static java.io.File getFileFromUrls(java.lang.String[] urls)
urls
- array of possible font urls
public void addFont(EmbedFontInfo fontInfo)
fontInfo
- font infopublic org.apache.fop.fonts.FontCache.CachedFontFile getFontFile(java.lang.String embedUrl)
embedUrl
- font info
public EmbedFontInfo[] getFontInfos(java.lang.String embedUrl, long lastModified)
embedUrl
- the font URLlastModified
- the last modified date/time of the font file
public void removeFont(java.lang.String embedUrl)
embedUrl
- embed urlpublic boolean isFailedFont(java.lang.String embedUrl, long lastModified)
embedUrl
- embed urllastModified
- last modified
public void registerFailedFont(java.lang.String embedUrl, long lastModified)
embedUrl
- embed urllastModified
- time last modifiedpublic void clear()
public static long getLastModified(java.net.URL url)
url
- the URL
|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |