Table of Contents

Struct SpanGraphemeEnumerator

Namespace
SixLabors.Fonts.Unicode
Assembly
SixLabors.Fonts.dll

An enumerator for retrieving Grapheme instances from a ReadOnlySpan<T>.
Implements the Unicode Grapheme Cluster Algorithm. UAX:29 https://www.unicode.org/reports/tr29/
Supports the UAX #29 extended grapheme cluster rule for Indic conjunct sequences (GB9c) using the IndicConjunctBreakClass property.
Methods are pattern-matched by compiler to allow using foreach pattern.

public ref struct SpanGraphemeEnumerator
Inherited Members

Constructors

SpanGraphemeEnumerator(ReadOnlySpan<char>)

Initializes a new instance of the SpanGraphemeEnumerator struct.

public SpanGraphemeEnumerator(ReadOnlySpan<char> source)

Parameters

source ReadOnlySpan<char>

The buffer to read from.

SpanGraphemeEnumerator(ReadOnlySpan<char>, TerminalWidthOptions)

Initializes a new instance of the SpanGraphemeEnumerator struct.

public SpanGraphemeEnumerator(ReadOnlySpan<char> source, TerminalWidthOptions terminalWidthOptions)

Parameters

source ReadOnlySpan<char>

The buffer to read from.

terminalWidthOptions TerminalWidthOptions

The terminal width options to apply while enumerating.

Properties

Current

Gets the element in the collection at the current position of the enumerator.

public readonly GraphemeCluster Current { get; }

Property Value

GraphemeCluster

Methods

GetEnumerator()

Returns an enumerator that iterates through the collection.

public readonly SpanGraphemeEnumerator GetEnumerator()

Returns

SpanGraphemeEnumerator

An enumerator that iterates through the collection.

MoveNext()

Advances the enumerator to the next element of the collection.

public bool MoveNext()

Returns

bool

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.