CffEncoding

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.font.IFontEncoding, com.aspose.font.ISupportsNameAddressing

public class CffEncoding implements IFontEncoding, ISupportsNameAddressing

Represents CFF font encoding.

Methods

MethodDescription
gidToUnicode(GlyphId gid)Decodes Gid to unicode.
encode(long gid, long charCode)Encodes the glyph.
unicodeToGid(long unicode)Decodes a unicode and returns glyph id.
decodeToGid(long charCode)Gets Gid for charCode passed.
decodeToGidParameterized(IEncodingParameters parameters, long charCode)Parameterized decode method.
getNameToCharCodeIndex()Returns name to character code encoding map.
getNameToGidIndex()Returns name to character code encoding map.
getNameToSidIndex()Returns name to character code encoding map.
getSidName(int sid)Gets name for the SID specified.

gidToUnicode(GlyphId gid)

public long gidToUnicode(GlyphId gid)

Decodes Gid to unicode. Glyph id is a unique number for a glyph, which is font type dependent. CFF Font glyph id can be instance of ( GlyphStringId ) class or ( GlyphUInt32Id ) class.

Parameters:

ParameterTypeDescription
gidGlyphIdGlyph 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. Not supported for CFF Font types.

Parameters:

ParameterTypeDescription
gidlongGlyph id
charCodelongCharCode associated with the glyph id.

unicodeToGid(long unicode)

public GlyphId unicodeToGid(long unicode)

Decodes a unicode and returns glyph id. Glyph id is a unique number for a glyph, which is font type dependent. CFF Font glyph id can be instance of ( GlyphStringId ) class or ( GlyphUInt32Id ) class.

Parameters:

ParameterTypeDescription
unicodelongUnicode to get glyph identifier for.

Returns: GlyphId - Glyph identifier related to unicode passed.

decodeToGid(long charCode)

public GlyphId decodeToGid(long charCode)

Gets Gid for charCode passed. This method designed for a CFF CIDFonts, where charCode must be a valid CID value. Glyph id is a unique number for a glyph, which is font type dependent. CFF Font glyph id can be instance of ( GlyphStringId ) class or ( GlyphUInt32Id ) class.

Parameters:

ParameterTypeDescription
charCodelongCharacter code (CID) to get glyph identifier for.

Returns: GlyphId - Glyph identifier related to CID passed.

decodeToGidParameterized(IEncodingParameters parameters, long charCode)

public GlyphId decodeToGidParameterized(IEncodingParameters parameters, long charCode)

Parameterized decode method. Not supported for CFF Font type.

Parameters:

ParameterTypeDescription
parametersIEncodingParametersImplementation of IEncodingParameters interface.
charCodelongCharacter code to get glyph identifier for.

Returns: GlyphId - Glyph identifier related to charCode passed.

getNameToCharCodeIndex()

public NameToCodeMap getNameToCharCodeIndex()

Returns name to character code encoding map. Note: character code is not a unicode. Character code is a char index in Font encoding “table”.

Returns: NameToCodeMap - Name to character code encoding map.

getNameToGidIndex()

public NameToCodeMap getNameToGidIndex()

Returns name to character code encoding map. Note: character code is not a unicode. Character code is a char index in Font encoding “table”.

Returns: NameToCodeMap - Name to character code encoding map.

getNameToSidIndex()

public NameToCodeMap getNameToSidIndex()

Returns name to character code encoding map. Note: character code is not a unicode. Character code is a char index in Font encoding “table”.

Returns: NameToCodeMap - Name to character code encoding map.

getSidName(int sid)

public String getSidName(int sid)

Gets name for the SID specified.

Parameters:

ParameterTypeDescription
sidintString identfier.

Returns: java.lang.String - Name from string INDEX if found.