Method Itemize
Itemize(ReadOnlySpan<char>, TextDirection)
Itemizes a text span into contiguous script/direction runs.
public static ScriptRun[] Itemize(ReadOnlySpan<char> text, TextDirection paragraphDirection)
Parameters
textReadOnlySpan<char>The input text.
paragraphDirectionTextDirectionThe resolved paragraph base direction.
Returns
- ScriptRun[]
Script runs in logical order.
Itemize(ReadOnlySpan<char>, TextDirection, TextDirection)
Itemizes a text span into contiguous script/direction runs, resolving every character
that has no strong direction of its own (punctuation, symbols, digits, spaces) to
neutralDirection instead of to the direction of the last strong
character. This is the run-level rule of ECMA-376 §17.3.2.30: the neutrals of a run
that carries w:rtl are right-to-left and those of a run without it are
left-to-right, whatever precedes them -- so the period that closes an Arabic sentence
after a Latin word is still right-to-left, and the brackets of a Latin caption inside
a right-to-left paragraph are still left-to-right. Strong characters keep their own
direction, and a run is still split wherever the script or the direction changes.
public static ScriptRun[] Itemize(ReadOnlySpan<char> text, TextDirection paragraphDirection, TextDirection neutralDirection)
Parameters
textReadOnlySpan<char>The input text.
paragraphDirectionTextDirectionThe resolved paragraph base direction.
neutralDirectionTextDirectionThe direction every non-strong character resolves to.
Returns
- ScriptRun[]
Script runs in logical order.