Function unicode_bidi::utf16::reorder_line

source ·
fn reorder_line(
    text: &[u16],
    line: Range<usize>,
    levels: Vec<Level>,
    runs: Vec<LevelRun>,
) -> Cow<'_, [u16]>
Expand description

Return a line of the text in display order based on resolved levels.

text the full text passed to the BidiInfo or ParagraphBidiInfo for analysis line a range of byte indices within text corresponding to one line levels array of Level values, with line’s levels reordered into visual order runs array of LevelRuns in visual order

(levels and runs are the result of calling BidiInfo::visual_runs() or ParagraphBidiInfo::visual_runs() for the line of interest.)

Returns: the reordered text of the line.

This does not apply Rule L3 or Rule L4 around combining characters or mirroring.