= Visual text order
<Visual text order> is the ordering of displayed text items within a rendered line. In bidirectional text it can differ from <logical text order>, the stored character sequence. It describes a presentation result, so the line boundaries and resolved directional information belong to its context.<Unicode Bidirectional Algorithm (Revision 51) by the Unicode Consortium>[section1 and section3.4: storage, display and line reordering]{ref}
For an original permutation example, take six logical items $a,R_1,1,2,R_2,b$ with supplied levels $0,1,2,2,1,0$. The resulting left-to-right display positions contain source indices
$$
\pi=(0,4,2,3,1,5).
$$
Thus the displayed items are $a,R_2,1,2,R_1,b$. The digits keep their internal order even though the surrounding right-to-left items exchange physical positions. A single reversal of the whole stored list would give a different result.
A position map preserves information that a picture alone may lose. If two source items both display as the same letter, their appearances do not reveal which logical index each came from. A renderer can retain distinct indices while drawing identical shapes. Likewise, interpreting a pointer position as a text location requires more information than simply treating a visual column number as a logical index.
The <Unicode Bidirectional Algorithm> orders text items, while <text shaping> determines additional glyph forms and combinations. Distinguishing these stages prevents a permutation of character positions from being mistaken for a complete specification of glyph geometry.<Unicode Bidirectional Algorithm (Revision 51) by the Unicode Consortium>[section3.5: interaction with shaping]{ref}
Visual order is therefore useful for describing what appears on a particular line, while <logical text order> supplies stable positions for the represented sequence. Reporting both orders and their mapping makes an example reproducible without assuming that the reader's own browser will display a mixed-direction string in the intended way.
Back to article page