• 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
      • GlyphMetrics
      • GlyphMissingException
      • GlyphRendererParameters
      • GlyphType
      • HintingMode
      • HorizontalAlignment
      • IColorGlyphRenderer
      • IFontCollection
      • IGlyphDecorationRenderer
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • InvalidFontFileException
      • InvalidFontTableException
      • IReadOnlyFontCollection
      • IReadOnlySystemFontCollection
      • KerningMode
      • LayoutMode
      • MissingFontTableException
      • SystemFonts
      • TextAlignment
      • TextAttributes
      • TextDecorations
      • TextDirection
      • TextJustification
      • TextMeasurer
      • TextOptions
      • TextRenderer
      • TextRun
      • VerticalAlignment
      • WordBreaking
    • SixLabors.Fonts.Tables.AdvancedTypographic
      • FeatureTags
      • GlyphClassDef
      • Tag
    • SixLabors.Fonts.Tables.TrueType
      • TrueTypeGlyphMetrics
    • SixLabors.Fonts.Tables.TrueType.Glyphs
      • GlyphOutline
    • SixLabors.Fonts.Unicode
      • BidiCharacterType
      • BidiClass
      • BidiPairedBracketType
      • CodePoint
      • GraphemeClusterClass
      • JoiningClass
      • JoiningGroup
      • JoiningType
      • LineBreakClass
      • MemoryExtensions
      • ScriptClass
      • SpanCodePointEnumerator
      • SpanGraphemeEnumerator
    • SixLabors.Fonts.WellKnownIds
      • KnownNameIds

    Class TextMeasurer

    Encapsulated logic for laying out and then measuring text properties.

    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

    CountLines(ReadOnlySpan<Char>, TextOptions)

    Gets the number of lines contained within the text.

    Declaration
    public static int CountLines(ReadOnlySpan<char> text, TextOptions options)
    Parameters
    Type Name Description
    ReadOnlySpan<Char> text

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    Int32

    The line count.

    | Improve this Doc View Source

    CountLines(String, TextOptions)

    Gets the number of lines contained within the text.

    Declaration
    public static int CountLines(string text, TextOptions options)
    Parameters
    Type Name Description
    String text

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    Int32

    The line count.

    | Improve this Doc View Source

    Measure(ReadOnlySpan<Char>, TextOptions)

    Measures the size of the text in pixel units.

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

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    FontRectangle

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

    | Improve this Doc View Source

    Measure(String, TextOptions)

    Measures the size of the text in pixel units.

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

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    FontRectangle

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

    | Improve this Doc View Source

    MeasureBounds(ReadOnlySpan<Char>, TextOptions)

    Measures the text bounds in pixel units.

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

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    FontRectangle

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

    | Improve this Doc View Source

    MeasureBounds(String, TextOptions)

    Measures the text bounds in pixel units.

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

    The text.

    TextOptions options

    The text shaping options.

    Returns
    Type Description
    FontRectangle

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

    | Improve this Doc View Source

    TryMeasureCharacterBounds(ReadOnlySpan<Char>, TextOptions, out GlyphBounds[])

    Measures the character bounds of the text in pixel units.

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

    The text.

    TextOptions options

    The text shaping options.

    GlyphBounds[] 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

    TryMeasureCharacterBounds(String, TextOptions, out GlyphBounds[])

    Measures the character bounds of the text in pixel units.

    Declaration
    public static bool TryMeasureCharacterBounds(string text, TextOptions options, out GlyphBounds[] characterBounds)
    Parameters
    Type Name Description
    String text

    The text.

    TextOptions options

    The text shaping options.

    GlyphBounds[] 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

    TryMeasureCharacterDimensions(ReadOnlySpan<Char>, TextOptions, out GlyphBounds[])

    Measures the size of each character of the text in pixel units.

    Declaration
    public static bool TryMeasureCharacterDimensions(ReadOnlySpan<char> text, TextOptions options, out GlyphBounds[] characterBounds)
    Parameters
    Type Name Description
    ReadOnlySpan<Char> text

    The text.

    TextOptions options

    The text shaping options.

    GlyphBounds[] characterBounds

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

    Returns
    Type Description
    Boolean

    Whether any of the characters had non-empty dimensions.

    | Improve this Doc View Source

    TryMeasureCharacterDimensions(String, TextOptions, out GlyphBounds[])

    Measures the size of each character of the text in pixel units.

    Declaration
    public static bool TryMeasureCharacterDimensions(string text, TextOptions options, out GlyphBounds[] characterBounds)
    Parameters
    Type Name Description
    String text

    The text.

    TextOptions options

    The text shaping options.

    GlyphBounds[] characterBounds

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

    Returns
    Type Description
    Boolean

    Whether any of the characters had non-empty dimensions.

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