|
fop 0.95 | |||||||||
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. |
CachedFontInfo |
getFont(java.lang.String embedUrl)
returns a font from the cache |
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 void addFont(EmbedFontInfo fontInfo)
fontInfo
- font infopublic CachedFontInfo getFont(java.lang.String embedUrl)
embedUrl
- font info
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()
|
fop 0.95 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |