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 Deprecated Methods Modifier and Type Method Description static void
clearSavedFonts()
Clears the cache by removing fonts that were added viasaveFont(FontProgram, String)
.static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>
getAllPredefinedCidFonts()
Deprecated.static CMapByteCid
getByte2CidCmap(java.lang.String cmap)
Deprecated.static CMapCidUni
getCid2UniCmap(java.lang.String uniMap)
Deprecated.in favour ofCjkResourceLoader
.static CMapCidToCodepoint
getCidToCodepointCmap(java.lang.String cmap)
Deprecated.static CMapCodepointToCid
getCodepointToCidCmap(java.lang.String uniMap)
Deprecated.static java.lang.String
getCompatibleCidFont(java.lang.String cmap)
Deprecated.in favour ofCjkResourceLoader
.static java.util.Set<java.lang.String>
getCompatibleCmaps(java.lang.String fontName)
Deprecated.in favour ofCjkResourceLoader
.(package private) static FontProgram
getFont(FontCacheKey key)
static FontProgram
getFont(java.lang.String fontName)
static java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getRegistryNames()
Deprecated.static CMapUniCid
getUni2CidCmap(java.lang.String uniMap)
Deprecated.protected static boolean
isPredefinedCidFont(java.lang.String fontName)
Deprecated.in favour ofCjkResourceLoader
.(package private) static FontProgram
saveFont(FontProgram font, FontCacheKey key)
static FontProgram
saveFont(FontProgram font, java.lang.String fontName)
-
-
-
Field Detail
-
fontCache
private static java.util.Map<FontCacheKey,FontProgram> fontCache
-
-
Method Detail
-
isPredefinedCidFont
@Deprecated protected static boolean isPredefinedCidFont(java.lang.String fontName)
Deprecated.in favour ofCjkResourceLoader
.Checks if the font with the given name and encoding is one of the predefined CID fonts.- Parameters:
fontName
- the font name.- Returns:
true
if it is CJKFont.
-
getCompatibleCidFont
@Deprecated public static java.lang.String getCompatibleCidFont(java.lang.String cmap)
Deprecated.in favour ofCjkResourceLoader
.Finds a CJK font family which is compatible to the given CMap.- Parameters:
cmap
- a name of the CMap for which compatible font is searched.- Returns:
- a CJK font name if there's known compatible font for the given cmap name, or null otherwise.
-
getCompatibleCmaps
@Deprecated public static java.util.Set<java.lang.String> getCompatibleCmaps(java.lang.String fontName)
Deprecated.in favour ofCjkResourceLoader
.Finds all CMap names that belong to the same registry to which a given font belongs.- Parameters:
fontName
- a name of the font for which CMap's are searched.- Returns:
- a set of CMap names corresponding to the given font.
-
getAllPredefinedCidFonts
@Deprecated public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getAllPredefinedCidFonts()
Deprecated.
-
getRegistryNames
@Deprecated public static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getRegistryNames()
Deprecated.
-
getCid2UniCmap
@Deprecated public static CMapCidUni getCid2UniCmap(java.lang.String uniMap)
Deprecated.in favour ofCjkResourceLoader
.Parses CMap with a given name producing it in a form of cid to unicode mapping.- Parameters:
uniMap
- a CMap name. It is expected that CMap identified by this name defines unicode to cid mapping.- Returns:
- an object for convenient mapping from cid to unicode. If no CMap was found for provided name an exception is thrown.
-
getUni2CidCmap
@Deprecated public static CMapUniCid getUni2CidCmap(java.lang.String uniMap)
Deprecated.
-
getByte2CidCmap
@Deprecated public static CMapByteCid getByte2CidCmap(java.lang.String cmap)
Deprecated.
-
getCidToCodepointCmap
@Deprecated public static CMapCidToCodepoint getCidToCodepointCmap(java.lang.String cmap)
Deprecated.
-
getCodepointToCidCmap
@Deprecated public static CMapCodepointToCid getCodepointToCidCmap(java.lang.String uniMap)
Deprecated.
-
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)
-
-