• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.Fonts
      • ColorFontSupport
      • Font
      • FontCollection
      • FontCollectionExtensions
      • FontDescription
      • FontException
      • FontFamily
      • FontFamilyNotFoundException
      • FontMetrics
      • FontRectangle
      • FontStyle
      • Glyph
      • GlyphBounds
      • GlyphColor
      • GlyphLayoutMode
      • GlyphMetrics
      • GlyphMissingException
      • GlyphRendererParameters
      • GlyphType
      • HintingMode
      • HorizontalAlignment
      • HorizontalMetrics
      • IColorGlyphRenderer
      • IFontCollection
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • IMetricsHeader
      • IReadOnlyFontCollection
      • IReadOnlySystemFontCollection
      • InvalidFontFileException
      • InvalidFontTableException
      • KerningMode
      • LayoutMode
      • LayoutModeExtensions
      • MissingFontTableException
      • SystemFonts
      • TextAlignment
      • TextAttributes
      • TextDecorations
      • TextDirection
      • TextJustification
      • TextMeasurer
      • TextOptions
      • TextRenderer
      • TextRun
      • VerticalAlignment
      • VerticalMetrics
      • WordBreaking
    • SixLabors.Fonts.Tables.AdvancedTypographic
      • FeatureTags
      • GlyphClassDef
      • Tag
    • SixLabors.Fonts.Tables.TrueType
      • TrueTypeGlyphMetrics
    • SixLabors.Fonts.Unicode
      • ArabicJoiningClass
      • ArabicJoiningGroup
      • ArabicJoiningType
      • BidiCharacterType
      • BidiClass
      • BidiPairedBracketType
      • CodePoint
      • GraphemeClusterClass
      • IndicPositionalCategory
      • IndicSyllabicCategory
      • LineBreakClass
      • MemoryExtensions
      • ScriptClass
      • SpanCodePointEnumerator
      • SpanGraphemeEnumerator
      • VerticalOrientationType
    • SixLabors.Fonts.WellKnownIds
      • KnownNameIds

    Class FontMetrics

    Represents a font face with metrics, which is a set of glyphs with a specific style (regular, italic, bold etc).

    Inheritance
    object
    FontMetrics
    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 abstract class FontMetrics

    Properties

    | Edit this page View Source

    Description

    Gets the basic description of the face.

    Declaration
    public abstract FontDescription Description { get; }
    Property Value
    Type Description
    FontDescription
    | Edit this page View Source

    HorizontalMetrics

    Gets the metrics specific to horizontal text.

    Declaration
    public abstract HorizontalMetrics HorizontalMetrics { get; }
    Property Value
    Type Description
    HorizontalMetrics
    | Edit this page View Source

    ItalicAngle

    Gets the italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

    Declaration
    public abstract float ItalicAngle { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    ScaleFactor

    Gets the scale factor that is applied to all glyphs in this face. Calculated as 72 * UnitsPerEm so that 1pt = 1px.

    Declaration
    public abstract float ScaleFactor { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    StrikeoutPosition

    Gets the position of the top of the strikeout stroke relative to the baseline in font design units.

    Declaration
    public abstract short StrikeoutPosition { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    StrikeoutSize

    Gets thickness of the strikeout stroke in font design units.

    Declaration
    public abstract short StrikeoutSize { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SubscriptXOffset

    Gets the recommended horizontal offset in font design units for subscripts for this font.

    Declaration
    public abstract short SubscriptXOffset { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SubscriptXSize

    Gets the recommended horizontal size in font design units for subscripts for this font.

    Declaration
    public abstract short SubscriptXSize { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SubscriptYOffset

    Gets the recommended vertical offset in font design units for subscripts for this font.

    Declaration
    public abstract short SubscriptYOffset { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SubscriptYSize

    Gets the recommended vertical size in font design units for subscripts for this font.

    Declaration
    public abstract short SubscriptYSize { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SuperscriptXOffset

    Gets the recommended horizontal offset in font design units for superscripts for this font.

    Declaration
    public abstract short SuperscriptXOffset { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SuperscriptXSize

    Gets the recommended horizontal size in font design units for superscripts for this font.

    Declaration
    public abstract short SuperscriptXSize { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SuperscriptYOffset

    Gets the recommended vertical offset in font design units for superscripts for this font.

    Declaration
    public abstract short SuperscriptYOffset { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    SuperscriptYSize

    Gets the recommended vertical size in font design units for superscripts for this font.

    Declaration
    public abstract short SuperscriptYSize { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    UnderlinePosition

    Gets the suggested distance of the top of the underline from the baseline (negative values indicate below baseline).

    Declaration
    public abstract short UnderlinePosition { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    UnderlineThickness

    Gets the suggested values for the underline thickness. In general, the underline thickness should match the thickness of the underscore character (U+005F LOW LINE), and should also match the strikeout thickness, which is specified in the OS/2 table.

    Declaration
    public abstract short UnderlineThickness { get; }
    Property Value
    Type Description
    short
    | Edit this page View Source

    UnitsPerEm

    Gets the number of font units per EM square for this face.

    Declaration
    public abstract ushort UnitsPerEm { get; }
    Property Value
    Type Description
    ushort
    | Edit this page View Source

    VerticalMetrics

    Gets the metrics specific to vertical text.

    Declaration
    public abstract VerticalMetrics VerticalMetrics { get; }
    Property Value
    Type Description
    VerticalMetrics

    Methods

    | Edit this page View Source

    GetAvailableCodePoints()

    Gets the unicode codepoints for which a glyph exists in the font.

    Declaration
    public abstract IReadOnlyList<CodePoint> GetAvailableCodePoints()
    Returns
    Type Description
    IReadOnlyList<CodePoint>

    The IReadOnlyList<T>.

    | Edit this page View Source

    TryGetGlyphMetrics(CodePoint, TextAttributes, TextDecorations, LayoutMode, ColorFontSupport, out IReadOnlyList<GlyphMetrics>?)

    Gets the glyph metrics for a given code point.

    Declaration
    public abstract bool TryGetGlyphMetrics(CodePoint codePoint, TextAttributes textAttributes, TextDecorations textDecorations, LayoutMode layoutMode, ColorFontSupport support, out IReadOnlyList<GlyphMetrics>? metrics)
    Parameters
    Type Name Description
    CodePoint codePoint

    The Unicode code point to get the glyph for.

    TextAttributes textAttributes

    The text attributes applied to the glyph.

    TextDecorations textDecorations

    The text decorations applied to the glyph.

    LayoutMode layoutMode

    The layout mode applied to the glyph.

    ColorFontSupport support

    Options for enabling color font support during layout and rendering.

    IReadOnlyList<GlyphMetrics> metrics

    When this method returns, contains the metrics for the given codepoint and color support if the metrics are found; otherwise the default value. This parameter is passed uninitialized.

    Returns
    Type Description
    bool

    true if the face contains glyph metrics for the specified codepoint; otherwise, false.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX