Class CjkResourceLoader
java.lang.Object
com.itextpdf.io.font.CjkResourceLoader
This class is responsible for loading and handling CJK fonts and CMaps from font-asian package.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IntHashtableGet all loaded predefined CID fonts.static CMapByteCidgetByte2CidCmap(String cmap) Parses CMap with a given name producing it in a form of byte to cid mapping.static CMapCidUnigetCid2UniCmap(String uniMap) Parses CMap with a given name producing it in a form of cid to unicode mapping.static CMapCidToCodepointgetCidToCodepointCmap(String cmap) Parses CMap with a given name producing it in a form of cid to code point mapping.static CMapCodepointToCidgetCodepointToCidCmap(String uniMap) Parses CMap with a given name producing it in a form of code point to cid mapping.static StringgetCompatibleCidFont(String cmap) Finds a CJK font family which is compatible to the given CMap.getCompatibleCmaps(String fontName) Finds all CMap names that belong to the same registry to which a given font belongs.Get all loaded CJK registry names mapped to a set of compatible cmaps.static CMapUniCidgetUni2CidCmap(String uniMap) Parses CMap with a given name producing it in a form of unicode to cid mapping.static booleanisPredefinedCidFont(String fontName) Checks if the font with the given name and encoding is one of the predefined CID fonts.private static voidprivate static <T extends AbstractCMap>
TreadFontProperties(String name) (package private) static voidsetCmapLocation(CMapLocationResource cmapLocation)
-
Field Details
-
allCidFonts
-
registryNames
-
CJK_REGISTRY_FILENAME
- See Also:
-
FONTS_PROP
- See Also:
-
REGISTRY_PROP
- See Also:
-
W_PROP
- See Also:
-
W2_PROP
- See Also:
-
cmapLocation
-
-
Constructor Details
-
CjkResourceLoader
private CjkResourceLoader()
-
-
Method Details
-
isPredefinedCidFont
Checks if the font with the given name and encoding is one of the predefined CID fonts.- Parameters:
fontName- the font name.- Returns:
trueif it is CJKFont.
-
getCompatibleCidFont
-
getCompatibleCmaps
-
getAllPredefinedCidFonts
-
getRegistryNames
-
getCid2UniCmap
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
Parses CMap with a given name producing it in a form of unicode to cid 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 unicode to cid. If no CMap was found for provided name an exception is thrown.
-
getByte2CidCmap
Parses CMap with a given name producing it in a form of byte to cid mapping.- Parameters:
cmap- a CMap name. It is expected that CMap identified by this name defines byte to cid mapping.- Returns:
- an object for convenient mapping from byte to cid. If no CMap was found for provided name an exception is thrown.
-
getCidToCodepointCmap
Parses CMap with a given name producing it in a form of cid to code point mapping.- Parameters:
cmap- a CMap name. It is expected that CMap identified by this name defines code point to cid mapping.- Returns:
- an object for convenient mapping from cid to code point. If no CMap was found for provided name an exception is thrown.
-
getCodepointToCidCmap
Parses CMap with a given name producing it in a form of code point to cid mapping.- Parameters:
uniMap- a CMap name. It is expected that CMap identified by this name defines code point to cid mapping.- Returns:
- an object for convenient mapping from code point to cid. If no CMap was found for provided name an exception is thrown.
-
setCmapLocation
-
loadRegistry
- Throws:
IOException
-
readFontProperties
- Throws:
IOException
-
createMetric
-
parseCmap
-