TtfEncoding
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.font.IFontEncoding
public class TtfEncoding implements IFontEncoding
Represents TTF Font encoding.
Methods
Method | Description |
---|---|
gidToUnicode(GlyphId glyphId) | Decodes glyph id to unicode. |
encode(long gid, long charCode) | Encodes the glyph. |
unicodeToGid(long unicode) | Decodes a unicode and returns glyph id. |
decodeToGid(long unicode) | TTF Font’s DecodeToGlyphId implementation finds unicode table and returns glyph id for unicode char. |
decodeToGidParameterized(IEncodingParameters parameters, long charCode) | Parametrized version allows to use specific CMap table (not unicode). |
gidToUnicode(GlyphId glyphId)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
glyphId | GlyphId | Glyph identifier of symbol to decode. |
Returns: long - Unicode value related to glyph id passed.
encode(long gid, long charCode)
public void encode(long gid, long charCode)
Encodes the glyph. For TTF Fonts the character code is unicode.
Parameters:
Parameter | Type | Description |
---|---|---|
gid | long | Glyph identifier. |
charCode | long | Character code. |
unicodeToGid(long unicode)
public GlyphId unicodeToGid(long unicode)
Decodes a unicode and returns glyph id.
Parameters:
Parameter | Type | Description |
---|---|---|
unicode | long | Unicode to get glyph identifier for. |
Returns: GlyphId - Glyph identifier related to unicode passed.
decodeToGid(long unicode)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
unicode | long | Character code to get glyph identifier for. |
Returns: GlyphId - Glyph identifier related to character code passed.
decodeToGidParameterized(IEncodingParameters parameters, long charCode)
public GlyphId decodeToGidParameterized(IEncodingParameters parameters, long charCode)
Parametrized version allows to use specific CMap table (not unicode).
Parameters:
Parameter | Type | Description |
---|---|---|
parameters | IEncodingParameters | Implementation of IEncodingParameters interface. |
charCode | long | character code to get glyph identifier for. |
Returns: GlyphId - Glyph identifier related to character code passed.