Class CmapSubtable

java.lang.Object
org.ofdrw.converter.font.CmapSubtable
All Implemented Interfaces:
org.apache.fontbox.ttf.CmapLookup

public class CmapSubtable extends Object implements org.apache.fontbox.ttf.CmapLookup
A "cmap" subtable.
Author:
Ben Litchfield
  • Constructor Details

    • CmapSubtable

      public CmapSubtable()
  • Method Details

    • initData

      public CmapSubtable initData(TTFDataStream data) throws IOException
      读取流解析 cmap子表

      This will read the required data from the stream.

      Parameters:
      data - The stream to read the data from.
      Returns:
      this
      Throws:
      IOException - If there is an error reading the data.
    • getPlatformEncodingId

      public int getPlatformEncodingId()
      Returns:
      Returns the platformEncodingId.
    • setPlatformEncodingId

      public void setPlatformEncodingId(int platformEncodingIdValue)
      Parameters:
      platformEncodingIdValue - The platformEncodingId to set.
    • getPlatformId

      public int getPlatformId()
      Returns:
      Returns the platformId.
    • setPlatformId

      public void setPlatformId(int platformIdValue)
      Parameters:
      platformIdValue - The platformId to set.
    • getGlyphId

      public int getGlyphId(int characterCode)
      Returns the GlyphId linked with the given character code.
      Specified by:
      getGlyphId in interface org.apache.fontbox.ttf.CmapLookup
      Parameters:
      characterCode - the given character code to be mapped
      Returns:
      glyphId the corresponding glyph id for the given character code
    • getCharCodes

      public List<Integer> getCharCodes(int gid)
      Returns all possible character codes for the given gid, or null if there is none.
      Specified by:
      getCharCodes in interface org.apache.fontbox.ttf.CmapLookup
      Parameters:
      gid - glyph id
      Returns:
      a list with all character codes the given gid maps to
    • toString

      public String toString()
      Overrides:
      toString in class Object