com.aspose.font

Interfaces

Classes

Enums

Exceptions

com.aspose.font

Class Type1MetricFont

  • All Implemented Interfaces:
    IFont, IFontSaver, IGlyphAccessor


    public class Type1MetricFont
    extends Type1Font

    Type1 metric font implementation. This type1 font is created using metrics only. Glyphs retrieval functions and some other that require real font are not allowed, not allowed functions throw exception Type1NotSupportedException. Other properties (FontName, Weight, Metrics and Encoding) are used from metrics file.


         Note: If metrics file defines Encoding as "FontSpecific", user should provide the specific encoding with following way:
         string[] zapfDingbatsEncoding = new string[256] {null, null, ... , "space", "a1", ...};
         FontEnvironment.Current.FontSpecificEncodings.RegisterEncoding("ZapfDingbats", zapfDingbatsEncoding);
     
         System::ArrayPtr<System::String> zapfDingbatsEncoding = System::MakeArray<System::String>({nullptr, nullptr, ..., u"space", u"a1", ...});
         FontEnvironment::get_Current()->get_FontSpecificEncodings()->RegisterEncoding(u"ZapfDingbats", zapfDingbatsEncoding);
     
     
    • Method Detail

      • getEncoding

        public IFontEncoding getEncoding()

        Encoding is defined in metrics file. StandardAdobeEncoding: the encoding is populated automatically


             FontSpecific:
                user should provide the specific encoding with following way:
             string[] zapfDingbatsEncoding = new string[256] {null, null, ... , "space", "a1", ...};
             FontEnvironment.Current.FontSpecificEncodings.RegisterEncoding("ZapfDingbats", zapfDingbatsEncoding);
         
             System::ArrayPtr<System::String> zapfDingbatsEncoding = System::MakeArray<System::String>({nullptr, nullptr, ..., u"space", u"a1", ...});
             FontEnvironment::get_Current()->get_FontSpecificEncodings()->RegisterEncoding(u"ZapfDingbats", zapfDingbatsEncoding);
         
         
        Specified by:
        getEncoding in interface IFont
        Overrides:
        getEncoding in class Type1Font
        Returns:
        Font encoding.
      • getFontStyle

        public int getFontStyle()

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

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

        public int getNumGlyphs()

        Gets number of glyphs in the Font.

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

        public Glyph getGlyphById(String id)

        Returns glyph by glyph Id. Not supported for (@code Type1MetricFont} type.

        Overrides:
        getGlyphById in class Type1Font
        Parameters:
        id - Glyph identifier.
        Returns:
        Glyph.
      • getAllGlyphIds

        public GlyphId[] getAllGlyphIds()

        Returns all glyph Ids, available in the Font. Not supported for Type1MetricFont type.

        Specified by:
        getAllGlyphIds in interface IGlyphAccessor
        Overrides:
        getAllGlyphIds in class Type1Font
        Returns:
        All glyph identifiers, available in the Font.