Bidirectional text in TRichView

<< Click to display table of contents >>

Bidirectional text in TRichView

Bidirectional mode specifies the reading order of text, order of items in lines, and placement of a vertical scrollbar.

The support for bidirectional text (Arabic or Hebrew) is turned off by default. In order to turn it on, set BiDiMode property of TRichView either to rvbdLeftToRight or to rvbdRightToLeft.

BiDiMode of document can be overridden by BiDiMode of paragraph, BiDiMode of paragraph can be overridden by BiDiMode of text item.

Mixed right-to-left and left-to-right text is supported, even inside the same text item.

Attaching of adjacent characters (common for Arabic languages) is supported too, but only inside the same item (not between items).

Bullets and numbering of paragraphs take BiDiMode into account: for RTL (right-to-left) paragraphs, list markers are positioned to the right.

Tab stops support BiDiMode too: they are inverted (including tab alignments) for RTL paragraphs.

Differences in Windows API and Uniscribe [VCL and LCL]

The results depends on the value of TextEngine:

if Windows API is selected, in rvbdUnspecified mode, results are completely incorrect for RTL text (wrong selection drawing and caret positions); the results are unreliable in other modes (may depend on the chosen font);

if Uniscribe is selected, the results are correct is all modes; in rvbdUnspecified mode, only rearrangement of items on lines is turned off.

Demo project

Demos\*\Assorted\International\RTL\