public abstract class CMap extends SubTable implements java.lang.Iterable<java.lang.Integer>
CMapTable.CMapId
that
defines the CMap. In the cmap table for a font there can only be one cmap
with a given cmap id (pair of platform and encoding ids) no matter what the
type of the cmap is.
The cmap implements Iterable<Integer>
to allow iteration over
characters that are mapped by the cmap. This iteration mostly returns the
characters mapped by the cmap. It will return all characters mapped by the
cmap to anything but .notdef but it may return some that are not
mapped or are mapped to .notdef. Various cmap tables provide ranges and
such to describe characters for lookup but without going the full way to
mapping to the glyph id it isn't always possible to tell if a character
will end up with a valid glyph id. So, some of the characters returned from
the iterator may still end up pointing to the .notdef glyph. However, the
number of such characters should be small in most cases with well designed
cmaps.Modifier and Type | Class and Description |
---|---|
static class |
CMap.Builder<T extends CMap> |
static class |
CMap.CMapFormat
CMap subtable formats.
|
Modifier and Type | Method and Description |
---|---|
CMapTable.CMapId |
cmapId()
Gets the cmap id for this cmap.
|
int |
encodingId()
Gets the encoding id for this cmap.
|
boolean |
equals(java.lang.Object obj) |
int |
format()
Gets the format of the cmap.
|
abstract int |
glyphId(int character)
Gets the glyph id for the character code provided.
|
int |
hashCode() |
abstract int |
language()
Gets the language of the cmap.
|
int |
platformId()
Gets the platform id for this cmap.
|
java.lang.String |
toString() |
dataLength, readFontData, serialize
public int format()
public CMapTable.CMapId cmapId()
public int platformId()
Font.PlatformId
public int encodingId()
Font.MacintoshEncodingId
,
Font.WindowsEncodingId
,
Font.UnicodeEncodingId
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract int language()
public abstract int glyphId(int character)
character
- character value using the encoding of the cmap tablepublic java.lang.String toString()
toString
in class FontDataTable