Words rearranged when applying style to rl2 text

General TRichView support forum. Please post your questions here
Post Reply
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Words rearranged when applying style to rl2 text

Post by csterg »

Hello Sergey,
applying a style to a r2l language (hebrew), causes rearranging of words.
I send by email a sample rvf file. Try to select 2nd or 3rd word and apply any style (e.g. bold) with RVActionTest.

Have i overlooked something?
Thanks
Costas
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, TRichView bidi text arrangement algorithm is not perfect, so in some cases the user needs to help the editor to get the correct result.
When drawing a single text item, TRichView relies on Window text rendering, so it is always displayed correctly.
But when the line consists of several items (like after making a word bold), items are arranged by TRichView according to BiDiMode settings and properties of outermost characters.
In your document:
RichViewEdit.BiDiMode = unspecified
paragraph's BiDiMode = unspecified
text's BiDiMode = LTR
These settings are not correct for bidi text. While the proper bidi processing is done on text level, bidi processing for paragraphs is turned off (because unspecified BiDiMode), so items are always arranged LTR on the line.
Set RichViewEdit's BiDiMode to LTR or, preferably, to RTL.
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Post by csterg »

It seems that setting the paragraph BidiMode to RTL does the trick. If the BidiMode = LTR it will not work (it was like that already).
OK, this is a good enough fix,
thank you very much,
Costsa
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Post by csterg »

OK, seems that i need to set:
TextStyle BiDi = RTL
Paragraph = LTR

The previous post is incorrect since the whole paragraph is made RTL...

Costas
Post Reply