• 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 TextMeasurer

    Encapulated logic for laying out and measuring text.

    Inheritance
    Object
    TextMeasurer
    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 static class TextMeasurer

    Methods

    | Improve this Doc View Source

    Measure(ReadOnlySpan<Char>, RendererOptions)

    Measures the text.

    Declaration
    public static FontRectangle Measure(ReadOnlySpan<char> text, RendererOptions options)
    Parameters
    Type Name Description
    ReadOnlySpan<Char> text

    The text.

    RendererOptions options

    The style.

    Returns
    Type Description
    FontRectangle

    The size of the text if it was to be rendered.

    | Improve this Doc View Source

    Measure(String, RendererOptions)

    Measures the text.

    Declaration
    public static FontRectangle Measure(string text, RendererOptions options)
    Parameters
    Type Name Description
    String text

    The text.

    RendererOptions options

    The style.

    Returns
    Type Description
    FontRectangle

    The size of the text if it was to be rendered.

    | Improve this Doc View Source

    MeasureBounds(ReadOnlySpan<Char>, RendererOptions)

    Measures the text.

    Declaration
    public static FontRectangle MeasureBounds(ReadOnlySpan<char> text, RendererOptions options)
    Parameters
    Type Name Description
    ReadOnlySpan<Char> text

    The text.

    RendererOptions options

    The style.

    Returns
    Type Description
    FontRectangle

    The size of the text if it was to be rendered.

    | Improve this Doc View Source

    MeasureBounds(String, RendererOptions)

    Measures the text.

    Declaration
    public static FontRectangle MeasureBounds(string text, RendererOptions options)
    Parameters
    Type Name Description
    String text

    The text.

    RendererOptions options

    The style.

    Returns
    Type Description
    FontRectangle

    The size of the text if it was to be rendered.

    | Improve this Doc View Source

    TryMeasureCharacterBounds(ReadOnlySpan<Char>, RendererOptions, out GlyphMetric[])

    Measures the character bounds of the text. For each control character the list contains a null element.

    Declaration
    public static bool TryMeasureCharacterBounds(ReadOnlySpan<char> text, RendererOptions options, out GlyphMetric[] characterBounds)
    Parameters
    Type Name Description
    ReadOnlySpan<Char> text

    The text.

    RendererOptions options

    The style.

    GlyphMetric[] characterBounds

    The list of character bounds of the text if it was to be rendered.

    Returns
    Type Description
    Boolean

    Whether any of the characters had non-empty bounds.

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