Understanding Bidirectional Text

Each language has its writing system, or script. Script includes the set of characters which are used for writing. Most languages can be viewed in a left-to-right (LTR) direction of the text, which means that writing begins from left-hand side of page, and concludes at the right-hand side. However there are scripts which have a right-to-left (RTL) direction, for example, Arabic and Hebrew.

Since both RTL and LTR directional text can be displayed within the same paragraph, these paragraphs are referred to as “bidirectional.” For example in the Hebrew text below, the text is written in the RTL direction, and numbers are LTR directional.

Image shows Hebrew text from right to left.

You read this sentence starting from the right side beginning with:

Image shows Hebrew text from right to left.

next reading number 1943, then reading:

Image shows Hebrew text from right to left.

Complex structures occur when a paragraph of one direction has a citation of different directional text. This citation can contain other citations, which can have original text direction and so on. Consequently text of different directions can be enclosed several times.

The part of the text which has the same direction is called a run.

Bidirectional text can be ordered in visual or logical order. When characters are ordered in the same way in which they are displayed - from left to right, it is a visual order. Entering or reading bidirectional text is done in logical order, which is the sequencing of characters ordered on the way in which characters should be read. Some text scripts require that characters be combined into one ligature when output.