com.aspose.font

Interfaces

Classes

Enums

Exceptions

com.aspose.font

Class TtfFont

    • Method Detail

      • getTtfTables

        public TtfTableRepository getTtfTables()

        Gets TTF tables.

        Returns:
        TTF tables.
      • getCffFont

        public Font getCffFont()

        Gets CFF Font if present.

        Returns:
        CFF Font.
      • getFontType

        public FontType getFontType()

        Gets Font type. Returns FontType.TTF value.

        Specified by:
        getFontType in interface IFont
        Specified by:
        getFontType in class Font
        Returns:
        Font type.
      • setFontFamily

        public void setFontFamily(String value)

        Sets Font family.

        Specified by:
        setFontFamily in interface IFont
        Specified by:
        setFontFamily in class Font
        Parameters:
        value - New Font family.
      • getStyle

        public String getStyle()

        Gets Font style. This is a raw string value provided by Font file.

        Specified by:
        getStyle in interface IFont
        Specified by:
        getStyle in class Font
        Returns:
        Font style.
      • setStyle

        public void setStyle(String value)

        Sets Font style. This is a raw string value provided by Font file.

        Specified by:
        setStyle in interface IFont
        Specified by:
        setStyle in class Font
        Parameters:
        value - New Font style.
      • getFontStyle

        public int getFontStyle()

        Gets Font style. This is a value computed and represented in generalized type.

        Specified by:
        getFontStyle in interface IFont
        Specified by:
        getFontStyle in class Font
        Returns:
        Font style. Usually, a combination of FontStyle class constant flag values or 0.
      • setFontName

        public void setFontName(String value)

        Sets Font face name.

        Specified by:
        setFontName in interface IFont
        Specified by:
        setFontName in class Font
        Parameters:
        value - New Font face name.
      • getNumGlyphs

        public int getNumGlyphs()

        Gets number of glyphs in the Font.

        Specified by:
        getNumGlyphs in interface IFont
        Specified by:
        getNumGlyphs in class Font
        Returns:
        Number of glyphs in the Font.
      • isSymbolic

        public boolean isSymbolic()

        Returns true in case Font is symbolic.

        Returns:
        True in case Font is symbolic.
      • getGlyphById

        public Glyph getGlyphById(GlyphId id)

        Returns glyph by glyph id. Glyph id is a unique number for a glyph, which is font type dependent. TTF Font glyph id can be instance of (GlyphStringId) class or (GlyphUInt32Id) class. Name (string) glyph addressing is supported for TTF Fonts via Post table mapping. In case CFF Font inside, the CFF structures are used to address glyphs by name.

        Specified by:
        getGlyphById in interface IGlyphAccessor
        Specified by:
        getGlyphById in class Font
        Parameters:
        id - Glyph id.
        Returns:
        Glyph.
      • getGlyphById

        public Glyph getGlyphById(String glyphName)

        Returns glyph by glyph name. Name (string) glyph addressing is supported for TTF fonts via Post table mapping. In case CFF Font inside, the CFF structures are used to address glyphs by name.

        Parameters:
        glyphName - Glyph string identifier.
        Returns:
        Glyph.
      • getGlyphById

        public Glyph getGlyphById(long id)

        Returns glyph by glyph id.

        Parameters:
        id - Glyph index.
        Returns:
        Glyph.
      • getAllGlyphIds

        public GlyphId[] getAllGlyphIds()

        Returns array of all glyph ids, available in the Font. Glyph id is a unique number for a glyph, which is font type dependent. TTF Font glyph id can be instance of (GlyphStringId) class or (GlyphUInt32Id) class. Name (string) glyph addressing is supported for TTF Fonts via Post table mapping. In case CFF Font inside, the CFF structures are used to address glyphs by name.

        Specified by:
        getAllGlyphIds in interface IGlyphAccessor
        Specified by:
        getAllGlyphIds in class Font
        Returns:
        Glyph identifiers.
      • getGlyphComponentsById

        public void getGlyphComponentsById(GlyphId id,
                                           GlyphIdList componentsToPopulate)

        Gets a glyph by glyph identifier passed and fills passed list of glyph identifiers with components of this glyph. Glyph id is a unique number for a glyph, which is font type dependent. TTF Font glyph id can be instance of (GlyphStringId) class or (GlyphUInt32Id) class. Name (string) glyph addressing is supported for TTF Fonts via Post table mapping. In case CFF Font inside, the CFF structures are used to address glyphs by name.


        Empty collection componentsToPopulate should be passed that will contain glyph components id list.
        Parameters:
        id - Glyph id.
        componentsToPopulate - List of glyph identifiers to fill.
      • getGlyphComponentsById

        public void getGlyphComponentsById(String glyphName,
                                           GlyphIdList componentsToPopulate)

        Gets a glyph by glyph name passed and fills passed list of glyph identifiers with components of this glyph.


        Empty collection componentsToPopulate should be passed that will contain glyph components id list.
        Parameters:
        glyphName - Glyph name.
        componentsToPopulate - List of glyph identifiers to fill.
      • getGlyphComponentsById

        public void getGlyphComponentsById(long id,
                                           GlyphIdList componentsToPopulate)

        Gets a glyph by glyph index passed and fills passed list of glyph identifiers with components of this glyph.


        Empty collection componentsToPopulate should be passed that will contain glyph components id list.
        Parameters:
        id - Glyph index.
        componentsToPopulate - List of glyph identifiers to fill.
      • convert

        public Font convert(FontType fontType)

        Converts the Font into another format. Note: TTF Font type is now supported only.

        Specified by:
        convert in interface IFont
        Specified by:
        convert in class Font
        Parameters:
        fontType - Font format type to convert into.
        Returns:
        Font converted into new format.