org.apache.fontbox.ttf

## Class CmapSubtable

- java.lang.Object
- - org.apache.fontbox.ttf.CmapSubtable

All Implemented Interfaces:
  CmapLookup

    public class CmapSubtable
    extends Object
    implements CmapLookup

A "cmap" subtable.

Author:
  Ben Litchfield

### Constructor Summary

Constructors
Constructor and Description
`CmapSubtable()`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`Integer` `getCharacterCode(int gid)` Deprecated. the mapping may be ambiguous, see `getCharCodes(int)`. The first mapped value is returned by default.
`List<Integer>` `getCharCodes(int gid)` Returns all possible character codes for the given gid, or null if there is none.
`int` `getGlyphId(int characterCode)` Returns the GlyphId linked with the given character code.
`int` `getPlatformEncodingId()`
`int` `getPlatformId()`
`void` `setPlatformEncodingId(int platformEncodingIdValue)`
`void` `setPlatformId(int platformIdValue)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CmapSubtable

    public CmapSubtable()

### Method Detail

#### 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 `CmapLookup`
Parameters:
  `characterCode` - the given character code to be mapped
Returns:
  glyphId the corresponding glyph id for the given character code

#### getCharacterCode

    @Deprecated
    public Integer getCharacterCode(int gid)

Deprecated. the mapping may be ambiguous, see `getCharCodes(int)`. The first mapped value is returned by default.
Returns the character code for the given GID, or null if there is none.

Parameters:
  `gid` - glyph id
Returns:
  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 `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`