Page 1 of 1
Words rearranged when applying style to rl2 text
Posted: Thu Apr 02, 2009 10:05 am
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
Posted: Sat Apr 04, 2009 12:16 pm
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.
Posted: Sun Apr 05, 2009 2:15 pm
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
Posted: Sun Apr 05, 2009 4:41 pm
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