public class TtfEncoding extends Object implements IFontEncoding
Represents TTF Font encoding.
Modifier and Type | Method and Description |
---|---|
GlyphId |
decodeToGid(long unicode)
TTF Font's DecodeToGlyphId implementation finds unicode table and returns glyph id for unicode char.
|
GlyphId |
decodeToGidParameterized(IEncodingParameters parameters,
long charCode)
Parametrized version allows to use specific CMap table (not unicode).
|
void |
encode(long gid,
long charCode)
Encodes the glyph.
|
long |
gidToUnicode(GlyphId glyphId)
Decodes glyph id to unicode.
|
GlyphId |
unicodeToGid(long unicode)
Decodes a unicode and returns glyph id.
|
public long gidToUnicode(GlyphId glyphId)
Decodes glyph id to unicode.
Glyph id is a unique number for a glyph, which is font type dependent.
For example:
Type1's id is a glyph name, instance of (GlyphStringId
) class.
TTF's id is an int index, instance of (GlyphUInt32Id
) class.
gidToUnicode
in interface IFontEncoding
glyphId
- Glyph identifier of symbol to decode.public void encode(long gid, long charCode)
Encodes the glyph. For TTF Fonts the character code is unicode.
encode
in interface IFontEncoding
gid
- Glyph identifier.charCode
- Character code.public GlyphId unicodeToGid(long unicode)
Decodes a unicode and returns glyph id.
unicodeToGid
in interface IFontEncoding
unicode
- Unicode to get glyph identifier for.public GlyphId decodeToGid(long unicode)
TTF Font's DecodeToGlyphId implementation finds unicode table and returns glyph id for unicode char.
Glyph id is a unique number for a glyph, which is font type dependent.
For example:
Type1's id is a glyph name, instance of (GlyphStringId
) class.
TTF's id is an int index, instance of (GlyphUInt32Id
) class.
decodeToGid
in interface IFontEncoding
unicode
- Character code to get glyph identifier for.public GlyphId decodeToGidParameterized(IEncodingParameters parameters, long charCode)
Parametrized version allows to use specific CMap table (not unicode).
decodeToGidParameterized
in interface IFontEncoding
parameters
- Implementation of IEncodingParameters
interface.charCode
- character code to get glyph identifier for.