public class FontCache extends Object
Constructor and Description |
---|
FontCache() |
Modifier and Type | Method and Description |
---|---|
static void |
clearSavedFonts()
Clears the cache by removing fonts that were added via saveFont(FontProgram, String) .
|
static Map<String,Map<String,Object>> |
getAllPredefinedCidFonts() |
static CMapByteCid |
getByte2CidCmap(String cmap) |
static CMapCidByte |
getCid2Byte(String cmap) |
static CMapCidUni |
getCid2UniCmap(String uniMap)
Parses CMap with a given name producing it in a form of cid to unicode mapping.
|
static String |
getCompatibleCidFont(String cmap)
Finds a CJK font family which is compatible to the given CMap.
|
static Set<String> |
getCompatibleCmaps(String fontName)
Finds all CMap names that belong to the same registry to which a given font belongs.
|
static FontProgram |
getFont(String fontName) |
static Map<String,Set<String>> |
getRegistryNames() |
static CMapUniCid |
getUni2CidCmap(String uniMap) |
protected static boolean |
isPredefinedCidFont(String fontName)
Checks if the font with the given name and encoding is one of the predefined CID fonts.
|
static FontProgram |
saveFont(FontProgram font, String fontName) |
protected static boolean isPredefinedCidFont(String fontName)
fontName
- the font name.
true
if it is CJKFont.
public static String getCompatibleCidFont(String cmap)
cmap
- a name of the CMap for which compatible font is searched.
public static Set<String> getCompatibleCmaps(String fontName)
fontName
- a name of the font for which CMap's are searched.
public static CMapCidUni getCid2UniCmap(String uniMap)
uniMap
- a CMap name. It is expected that CMap identified by this name defines unicode to cid mapping.
public static CMapUniCid getUni2CidCmap(String uniMap)
public static CMapByteCid getByte2CidCmap(String cmap)
public static CMapCidByte getCid2Byte(String cmap)
public static void clearSavedFonts()
saveFont(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 when cached
argument is set to true (which is by default).
public static FontProgram getFont(String fontName)
public static FontProgram saveFont(FontProgram font, String fontName)
Copyright © 1998–2023 iText Group NV. All rights reserved.