• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.Fonts
      • ColorFontSupport
      • Font
      • FontCollection
      • FontDescription
      • FontFamily
      • FontFamilyCollectionExtensions
      • FontInstance
      • FontRectangle
      • FontStyle
      • Glyph
      • GlyphColor
      • GlyphInstance
      • GlyphMetric
      • GlyphRendererParameters
      • GlyphType
      • HorizontalAlignment
      • IColorGlyphRenderer
      • IFontCollection
      • IFontInstance
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • IReadOnlyFontCollection
      • IReadonlyFontCollectionExtensions
      • RendererOptions
      • SystemFonts
      • TextMeasurer
      • TextRenderer
      • VerticalAlignment
    • SixLabors.Fonts.Exceptions
      • FontException
      • FontFamilyNotFoundException
      • GlyphMissingException
      • InvalidFontFileException
      • InvalidFontTableException
      • MissingFontTableException

    Class FontInstance

    provide metadata about a font.

    Inheritance
    Object
    FontInstance
    Implements
    IFontInstance
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: SixLabors.Fonts
    Assembly: SixLabors.Fonts.dll
    Syntax
    public class FontInstance : IFontInstance

    Properties

    | Improve this Doc View Source

    Ascender

    Gets the ascender.

    Declaration
    public short Ascender { get; }
    Property Value
    Type Description
    Int16
    | Improve this Doc View Source

    Descender

    Gets the descender.

    Declaration
    public short Descender { get; }
    Property Value
    Type Description
    Int16
    | Improve this Doc View Source

    Description

    Gets the basic descripton of the font instance type.

    Declaration
    public FontDescription Description { get; }
    Property Value
    Type Description
    FontDescription
    | Improve this Doc View Source

    EmSize

    Gets the size of the em.

    Declaration
    public ushort EmSize { get; }
    Property Value
    Type Description
    UInt16

    The size of the em.

    | Improve this Doc View Source

    LineGap

    Gets the line gap.

    Declaration
    public short LineGap { get; }
    Property Value
    Type Description
    Int16
    | Improve this Doc View Source

    LineHeight

    Gets the height of the line.

    Declaration
    public int LineHeight { get; }
    Property Value
    Type Description
    Int32

    The height of the line.

    Methods

    | Improve this Doc View Source

    LoadFont(Stream)

    Reads a FontInstance from the specified stream.

    Declaration
    public static FontInstance LoadFont(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream.

    Returns
    Type Description
    FontInstance

    a FontInstance.

    | Improve this Doc View Source

    LoadFont(String)

    Reads a FontInstance from the specified stream.

    Declaration
    public static FontInstance LoadFont(string path)
    Parameters
    Type Name Description
    String path

    The file path.

    Returns
    Type Description
    FontInstance

    a FontInstance.

    | Improve this Doc View Source

    LoadFont(String, Int64)

    Reads a FontInstance from the specified stream.

    Declaration
    public static FontInstance LoadFont(string path, long offset)
    Parameters
    Type Name Description
    String path

    The file path.

    Int64 offset

    Position in the stream to read the font from.

    Returns
    Type Description
    FontInstance

    a FontInstance.

    | Improve this Doc View Source

    LoadFontCollection(Stream)

    Reads a FontInstance from the specified stream.

    Declaration
    public static FontInstance[] LoadFontCollection(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream.

    Returns
    Type Description
    FontInstance[]

    a FontInstance.

    | Improve this Doc View Source

    LoadFontCollection(String)

    Reads a FontInstance from the specified stream.

    Declaration
    public static FontInstance[] LoadFontCollection(string path)
    Parameters
    Type Name Description
    String path

    The file path.

    Returns
    Type Description
    FontInstance[]

    a FontInstance.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IFontInstance.GetGlyph(Int32)

    Gets the glyph.

    Declaration
    GlyphInstance IFontInstance.GetGlyph(int codePoint)
    Parameters
    Type Name Description
    Int32 codePoint

    The code point of the character.

    Returns
    Type Description
    GlyphInstance

    the glyph for a known character.

    | Improve this Doc View Source

    IFontInstance.GetOffset(GlyphInstance, GlyphInstance)

    Gets the amount the glyph should be ofset if it was proceeded by the previousGlyph.

    Declaration
    Vector2 IFontInstance.GetOffset(GlyphInstance glyph, GlyphInstance previousGlyph)
    Parameters
    Type Name Description
    GlyphInstance glyph

    The glyph.

    GlyphInstance previousGlyph

    The previous glyph.

    Returns
    Type Description
    Vector2

    A Vector2 represting the offset that should be applied to the glyph.

    Implements

    IFontInstance
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX