Class PDFCMap

java.lang.Object
org.loboevolution.pdfview.font.cid.PDFCMap
Direct Known Subclasses:
ToUnicodeMap

public abstract class PDFCMap extends Object
A CMap maps from a character in a composite font to a font/glyph number pair in a CID font.

Author jkaplan

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new instance of CMap
  • Method Summary

    Modifier and Type
    Method
    Description
    static PDFCMap
    getCMap(String mapName)
    Get a CMap, given a string name
    static PDFCMap
    Get a CMap, given a PDF object containing one of the following: a string name of a known CMap a stream containing a CMap definition
    int
    getFontID(char src)
    Get the font number assoicated with a given source character
    abstract char
    map(char src)
    Map a given source character to a destination character
    protected static PDFCMap
    Parse a CMap from a CMap stream
    protected static void
    Populate the cache with well-known types

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PDFCMap

      protected PDFCMap()
      Creates a new instance of CMap
  • Method Details

    • getCMap

      public static PDFCMap getCMap(PDFObject map) throws IOException
      Get a CMap, given a PDF object containing one of the following: a string name of a known CMap a stream containing a CMap definition
      Parameters:
      map - a PDFObject object.
      Returns:
      a PDFCMap object.
      Throws:
      IOException - if any.
    • getCMap

      public static PDFCMap getCMap(String mapName) throws IOException
      Get a CMap, given a string name
      Parameters:
      mapName - a String object.
      Returns:
      a PDFCMap object.
      Throws:
      IOException - if any.
    • populateCache

      protected static void populateCache()
      Populate the cache with well-known types
    • parseCMap

      protected static PDFCMap parseCMap(PDFObject map) throws IOException
      Parse a CMap from a CMap stream
      Parameters:
      map - a PDFObject object.
      Returns:
      a PDFCMap object.
      Throws:
      IOException - if any.
    • map

      public abstract char map(char src)
      Map a given source character to a destination character
      Parameters:
      src - a char.
      Returns:
      a char.
    • getFontID

      public int getFontID(char src)
      Get the font number assoicated with a given source character
      Parameters:
      src - a char.
      Returns:
      a Integer object.