Package com.itextpdf.io.font.cmap
Class CMapCharsetEncoder
java.lang.Object
com.itextpdf.io.font.cmap.CMapCharsetEncoder
Encodes Unicode code points for a standard CMap charset.
-
Constructor Summary
ConstructorsConstructorDescriptionCMapCharsetEncoder(Charset targetCharset) Creates an encoder that accepts all Unicode code points supported by the charset.CMapCharsetEncoder(Charset targetCharset, boolean bmpOnly) Creates an encoder with an optional Basic Multilingual Plane restriction. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encodeUnicodeCodePoint(int cp) Encodes one Unicode code point.
-
Constructor Details
-
CMapCharsetEncoder
Creates an encoder that accepts all Unicode code points supported by the charset.- Parameters:
-
targetCharset- the charset used to encode code points
-
CMapCharsetEncoder
Creates an encoder with an optional Basic Multilingual Plane restriction.- Parameters:
-
targetCharset- the charset used to encode code points -
bmpOnly-trueto reject supplementary code points
-
-
Method Details
-
encodeUnicodeCodePoint
public byte[] encodeUnicodeCodePoint(int cp) Encodes one Unicode code point.- Parameters:
-
cp- the Unicode code point to encode - Returns:
- a newly allocated encoded byte sequence
- Throws:
-
ITextException- if the code point cannot be encoded or is supplementary when BMP-only encoding is used
-