Class CMapFormat4

java.lang.Object
org.loboevolution.pdfview.font.ttf.CMap
org.loboevolution.pdfview.font.ttf.CMapFormat4

public class CMapFormat4 extends CMap

CMapFormat4 class.

Author jkaplan

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final SortedMap<org.loboevolution.pdfview.font.ttf.CMapFormat4.Segment,Object>
    The segments and associated data can be a char[] or an Integer
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CMapFormat4(short language)
    Creates a new instance of CMapFormat0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSegment(short startCode, short endCode, char[] map)
    Add a segment with a map
    void
    addSegment(short startCode, short endCode, short idDelta)
    Add a segment with an idDelta
    Get the data in this map as a byte buffer
    short
    Get the entry selector
    short
    Get the length of this map
    short
    Get the rangeShift()
    short
    Get the search range
    short
    Get the segment count
    byte
    map(byte src)
    Map an 8 bit value to another 8 bit value
    char
    map(char src)
    Map a 16 bit value to another 16 but value
    void
    removeSegment(short startCode, short endCode)
    Remove a segment
    char
    reverseMap(short glyphID)
    Get the src code which maps to the given glyphID
    void
    setData(int length, ByteBuffer data)
    Set the data for this map

    Methods inherited from class org.loboevolution.pdfview.font.ttf.CMap

    createMap, getMap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • segments

      public final SortedMap<org.loboevolution.pdfview.font.ttf.CMapFormat4.Segment,Object> segments
      The segments and associated data can be a char[] or an Integer
  • Constructor Details

    • CMapFormat4

      protected CMapFormat4(short language)
      Creates a new instance of CMapFormat0
      Parameters:
      language - a short.
  • Method Details

    • addSegment

      public void addSegment(short startCode, short endCode, char[] map)
      Add a segment with a map
      Parameters:
      startCode - a short.
      endCode - a short.
      map - an array of
      invalid reference
      char
      objects.
    • addSegment

      public void addSegment(short startCode, short endCode, short idDelta)
      Add a segment with an idDelta
      Parameters:
      startCode - a short.
      endCode - a short.
      idDelta - a short.
    • removeSegment

      public void removeSegment(short startCode, short endCode)
      Remove a segment
      Parameters:
      startCode - a short.
      endCode - a short.
    • getLength

      public short getLength()
      Get the length of this map

      Get the length of this table

      Specified by:
      getLength in class CMap
      Returns:
      a short.
    • map

      public byte map(byte src)
      Map an 8 bit value to another 8 bit value

      Cannot map from a byte

      Specified by:
      map in class CMap
      Parameters:
      src - a byte.
      Returns:
      a byte.
    • map

      public char map(char src)
      Map a 16 bit value to another 16 but value

      Map from char

      Specified by:
      map in class CMap
      Parameters:
      src - a char.
      Returns:
      a char.
    • reverseMap

      public char reverseMap(short glyphID)
      Get the src code which maps to the given glyphID

      Get the src code which maps to the given glyphID

      Specified by:
      reverseMap in class CMap
      Parameters:
      glyphID - a short.
      Returns:
      a char.
    • setData

      public void setData(int length, ByteBuffer data)
      Set the data for this map

      Get the data in this map as a ByteBuffer

      Specified by:
      setData in class CMap
      Parameters:
      length - a Integer object.
      data - a ByteBuffer object.
    • getData

      public ByteBuffer getData()
      Get the data in this map as a byte buffer

      Get the data in the map as a byte buffer

      Specified by:
      getData in class CMap
      Returns:
      a ByteBuffer object.
    • getSegmentCount

      public short getSegmentCount()
      Get the segment count
      Returns:
      a short.
    • getSearchRange

      public short getSearchRange()
      Get the search range
      Returns:
      a short.
    • getEntrySelector

      public short getEntrySelector()
      Get the entry selector
      Returns:
      a short.
    • getRangeShift

      public short getRangeShift()
      Get the rangeShift()
      Returns:
      a short.
    • toString

      public String toString()

      Print a pretty string

      Get a pretty string

      Overrides:
      toString in class CMap