Function unicode_bidi::reorder_line

source ·
pub(crate) fn reorder_line<'text>(
    text: &'text str,
    line: Range<usize>,
    levels: Vec<Level>,
    runs: Vec<LevelRun>
) -> Cow<'text, str>
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.