Class CMapCharsetEncoder

java.lang.Object
com.itextpdf.io.font.cmap.CMapCharsetEncoder

public final class CMapCharsetEncoder extends Object
Encodes Unicode code points for a standard CMap charset.
  • Constructor Details

    • CMapCharsetEncoder

      public CMapCharsetEncoder (Charset targetCharset)
      Creates an encoder that accepts all Unicode code points supported by the charset.
      Parameters:
      targetCharset - the charset used to encode code points
    • CMapCharsetEncoder

      public CMapCharsetEncoder (Charset targetCharset, boolean bmpOnly)
      Creates an encoder with an optional Basic Multilingual Plane restriction.
      Parameters:
      targetCharset - the charset used to encode code points
      bmpOnly - true to 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