com.aspose.font

Interfaces

Classes

Enums

Exceptions

com.aspose.font

Class TtfEncoding

    • Method Detail

      • gidToUnicode

        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.

        Specified by:
        gidToUnicode in interface IFontEncoding
        Parameters:
        glyphId - Glyph identifier of symbol to decode.
        Returns:
        Unicode value related to glyph id passed.
      • encode

        public void encode(long gid,
                           long charCode)

        Encodes the glyph. For TTF Fonts the character code is unicode.

        Specified by:
        encode in interface IFontEncoding
        Parameters:
        gid - Glyph identifier.
        charCode - Character code.
      • unicodeToGid

        public GlyphId unicodeToGid(long unicode)

        Decodes a unicode and returns glyph id.

        Specified by:
        unicodeToGid in interface IFontEncoding
        Parameters:
        unicode - Unicode to get glyph identifier for.
        Returns:
        Glyph identifier related to unicode passed.
      • decodeToGid

        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.

        Specified by:
        decodeToGid in interface IFontEncoding
        Parameters:
        unicode - Character code to get glyph identifier for.
        Returns:
        Glyph identifier related to character code passed.
      • decodeToGidParameterized

        public GlyphId decodeToGidParameterized(IEncodingParameters parameters,
                                                long charCode)

        Parametrized version allows to use specific CMap table (not unicode).

        Specified by:
        decodeToGidParameterized in interface IFontEncoding
        Parameters:
        parameters - Implementation of IEncodingParameters interface.
        charCode - character code to get glyph identifier for.
        Returns:
        Glyph identifier related to character code passed.