Package com.itextpdf.io.font
Class FontCache
- java.lang.Object
-
- com.itextpdf.io.font.FontCache
-
public class FontCache extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<FontCacheKey,FontProgram>
fontCache
-
Constructor Summary
Constructors Constructor Description FontCache()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearSavedFonts()
Clears the cache by removing fonts that were added viasaveFont(FontProgram, String)
.(package private) static FontProgram
getFont(FontCacheKey key)
static FontProgram
getFont(java.lang.String fontName)
(package private) static FontProgram
saveFont(FontProgram font, FontCacheKey key)
static FontProgram
saveFont(FontProgram font, java.lang.String fontName)
-
-
-
Field Detail
-
fontCache
private static final java.util.Map<FontCacheKey,FontProgram> fontCache
-
-
Method Detail
-
clearSavedFonts
public static void clearSavedFonts()
Clears the cache by removing fonts that were added viasaveFont(FontProgram, String)
.Be aware that in multithreading environment this method call will affect the result of
getFont(String)
. This in its turn affects creation of fonts via factories whencached
argument is set to true (which is by default).
-
getFont
public static FontProgram getFont(java.lang.String fontName)
-
getFont
static FontProgram getFont(FontCacheKey key)
-
saveFont
public static FontProgram saveFont(FontProgram font, java.lang.String fontName)
-
saveFont
static FontProgram saveFont(FontProgram font, FontCacheKey key)
-
-