Search Results for

    Show / Hide Table of Contents

    Class TrueTypeFont

    TrueTypeFont object

    Inheritance
    System.Object
    TTF_Helpers
    OpenTypeFontBase
    TrueTypeFont
    Inherited Members
    OpenTypeFontBase.stream
    OpenTypeFontBase.TablesList
    OpenTypeFontBase.Header
    OpenTypeFontBase.Names
    OpenTypeFontBase.MaxProfile
    OpenTypeFontBase.Postscript
    OpenTypeFontBase.GetNames(NameTableClass.NameID)
    OpenTypeFontBase.Name
    OpenTypeFontBase.Family
    OpenTypeFontBase.Family2016
    OpenTypeFontBase.SecondFamily
    OpenTypeFontBase.PostscriptName
    OpenTypeFontBase.Stream
    OpenTypeFontBase.PrepareFontName()
    TTF_Helpers.SwapUInt16(UInt16)
    TTF_Helpers.SwapInt16(Int16)
    TTF_Helpers.SwapUInt32(UInt32)
    TTF_Helpers.SwapInt32(Int32)
    TTF_Helpers.SwapUInt64(UInt64)
    Namespace: FastReport.Fonts
    Assembly: FastReport.dll
    Syntax
    public class TrueTypeFont : OpenTypeFontBase, IDisposable

    Constructors

    TrueTypeFont(FontStream, UInt32)

    Constructor of TrueTypeFont object

    Declaration
    public TrueTypeFont(FontStream stream, uint subfont_offset)
    Parameters
    Type Name Description
    FontStream stream

    Strean with font

    System.UInt32 subfont_offset

    Disposition of subfont within collection file. Non-zero for font collections

    Fields

    checksum_action

    Declaration
    public TrueTypeFont.ChecksumFaultAction checksum_action
    Field Value
    Type Description
    TrueTypeFont.ChecksumFaultAction

    Properties

    Ascender

    Declaration
    public float Ascender { get; }
    Property Value
    Type Description
    System.Single

    baseLine

    Declaration
    public float baseLine { get; }
    Property Value
    Type Description
    System.Single

    Bold

    Declaration
    public bool Bold { get; }
    Property Value
    Type Description
    System.Boolean

    FastName

    Declaration
    public string FastName { get; }
    Property Value
    Type Description
    System.String

    FileSize

    Declaration
    public uint FileSize { get; set; }
    Property Value
    Type Description
    System.UInt32

    FontVersion

    Declaration
    public uint FontVersion { get; }
    Property Value
    Type Description
    System.UInt32

    Glyphs

    Declaration
    public GlyphTableClass Glyphs { get; }
    Property Value
    Type Description
    GlyphTableClass

    HMetrics

    Declaration
    public HorizontalMetrixClass HMetrics { get; }
    Property Value
    Type Description
    HorizontalMetrixClass

    I2L

    Declaration
    public IndexToLocationClass I2L { get; }
    Property Value
    Type Description
    IndexToLocationClass

    IsClassicFormat

    Declaration
    public bool IsClassicFormat { get; }
    Property Value
    Type Description
    System.Boolean

    IsCollection

    Declaration
    public bool IsCollection { get; }
    Property Value
    Type Description
    System.Boolean

    Italic

    Declaration
    public bool Italic { get; set; }
    Property Value
    Type Description
    System.Boolean

    Kerning

    Declaration
    public KerningTableClass Kerning { get; }
    Property Value
    Type Description
    KerningTableClass

    Language

    Get or set current Language

    Declaration
    public string Language { get; set; }
    Property Value
    Type Description
    System.String

    LeftOffSet

    Declaration
    public float LeftOffSet { get; }
    Property Value
    Type Description
    System.Single

    LicensingRights

    Declaration
    public int LicensingRights { get; }
    Property Value
    Type Description
    System.Int32

    OS2WindowsMetrics

    Declaration
    public OS2WindowsMetricsClass OS2WindowsMetrics { get; }
    Property Value
    Type Description
    OS2WindowsMetricsClass

    Script

    Get or set current script

    Declaration
    public string Script { get; set; }
    Property Value
    Type Description
    System.String

    Scripts

    Get available scripts

    Declaration
    public IEnumerable<string> Scripts { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.String>

    Type

    Declaration
    public FontType Type { get; set; }
    Property Value
    Type Description
    FontType

    Methods

    DrawGSUBTable(Int32, Int32, Single, GlyphSubstitutionClass.LookupTypes[])

    Declaration
    public Dictionary<string, List<FastGraphicsPath>> DrawGSUBTable(int lineHeight, int columnWidth, float fontSize, GlyphSubstitutionClass.LookupTypes[] types)
    Parameters
    Type Name Description
    System.Int32 lineHeight
    System.Int32 columnWidth
    System.Single fontSize
    GlyphSubstitutionClass.LookupTypes[] types
    Returns
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<FastGraphicsPath>>

    DrawString(String, PointF, Single)

    Create outline for text string

    Declaration
    public FastGraphicsPath DrawString(string text, PointF position, float size)
    Parameters
    Type Name Description
    System.String text

    text which will be transformed to outline

    System.Drawing.PointF position

    position of text

    System.Single size

    font size in px

    Returns
    Type Description
    FastGraphicsPath

    text in form of outline vectors

    DrawString(UInt16[], PointF, Single)

    Create outline for group of characters

    Declaration
    public FastGraphicsPath DrawString(ushort[] text, PointF position, float size)
    Parameters
    Type Name Description
    System.UInt16[] text

    text as array of glyph's indexes

    System.Drawing.PointF position

    position of text

    System.Single size

    font size

    Returns
    Type Description
    FastGraphicsPath

    text in form of outline vectors

    Finalize()

    Destructor of TrueTypeFont object

    Declaration
    protected void Finalize()

    GetFeatures(String, String)

    Get available features for language and script

    Declaration
    public IEnumerable<string> GetFeatures(string script, string language)
    Parameters
    Type Name Description
    System.String script
    System.String language
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.String>

    GetFontData()

    Declaration
    public byte[] GetFontData()
    Returns
    Type Description
    System.Byte[]

    GetFontKey(Font)

    Declaration
    public static string GetFontKey(Font f)
    Parameters
    Type Name Description
    System.Drawing.Font f
    Returns
    Type Description
    System.String

    GetFontKey(String, TrueTypeFont)

    Declaration
    public static string GetFontKey(string familyName, TrueTypeFont f)
    Parameters
    Type Name Description
    System.String familyName
    TrueTypeFont f
    Returns
    Type Description
    System.String

    GetFullRawFontData()

    Return full raw image of the font

    Declaration
    public byte[] GetFullRawFontData()
    Returns
    Type Description
    System.Byte[]

    Array of font bytes

    GetGlyph(Char, Int32, PointF)

    Create glyph outline assigned to specific position

    Declaration
    public FastGraphicsPath GetGlyph(char ch, int size, PointF position)
    Parameters
    Type Name Description
    System.Char ch

    unicode character which will be drawn

    System.Int32 size

    size of the character

    System.Drawing.PointF position

    position of outline

    Returns
    Type Description
    FastGraphicsPath

    outline of character

    GetGlyph(UInt16, Single)

    Get glyph's outline

    Declaration
    public FastGraphicsPath GetGlyph(ushort ch, float size)
    Parameters
    Type Name Description
    System.UInt16 ch

    unicode charter

    System.Single size

    outline image size

    Returns
    Type Description
    FastGraphicsPath

    GetGlyphIndices(String, Single, out UInt16[], out Single[], out Single[], Boolean)

    Translate text to positions of glyphs in glyph tables and glyphs width

    Declaration
    public int GetGlyphIndices(string text, float font_size, out ushort[] glyphs, out float[] widths, out float[] kernings, bool rtl)
    Parameters
    Type Name Description
    System.String text
    System.Single font_size

    size in px

    System.UInt16[] glyphs
    System.Single[] widths
    System.Single[] kernings
    System.Boolean rtl
    Returns
    Type Description
    System.Int32

    GetLanguages(String)

    Get available languages for script

    Declaration
    public IEnumerable<string> GetLanguages(string script)
    Parameters
    Type Name Description
    System.String script
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.String>

    GetOutlineTextMetrics(ref TrueTypeFont.OutlineTextMetric)

    Emulation of Uniscribe GetOutlineTextMetrics

    Declaration
    public void GetOutlineTextMetrics(ref TrueTypeFont.OutlineTextMetric TextMetric)
    Parameters
    Type Name Description
    TrueTypeFont.OutlineTextMetric TextMetric

    Reference to metric structure

    GetRawFontData()

    Return raw image of the font

    Declaration
    public byte[] GetRawFontData()
    Returns
    Type Description
    System.Byte[]

    Array of font bytes

    PackFont(ref Dictionary<UInt16, GlyphChar>, TrueTypeFont.FontPackOptions)

    Cut some information from TTF file to reduce its size

    Declaration
    public byte[] PackFont(ref Dictionary<ushort, GlyphChar> dict, TrueTypeFont.FontPackOptions options)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.UInt16, GlyphChar> dict

    Alphabet subset dictionary

    TrueTypeFont.FontPackOptions options

    Describes how to pack font

    Returns
    Type Description
    System.Byte[]

    PrepareCommonTables()

    Parse font supplement tables which store properties of the font

    Declaration
    public void PrepareCommonTables()

    PrepareIndexes()

    Prepare tables for drawing, subsetting and so on

    Declaration
    public bool PrepareIndexes()
    Returns
    Type Description
    System.Boolean

    always true

    Back to top © 1998-2025 Copyright Fast Reports Inc.