RightToLeft mode problem

General TRichView support forum. Please post your questions here
Post Reply
eddy_m
Posts: 2
Joined: Sun Dec 18, 2005 4:35 pm

RightToLeft mode problem

Post by eddy_m »

1.RVE, TextStyle, ParaStyle are set to BiDiMode = rvbdRightToLeft.
2.Enter number which contains "a period" in the middle eg. 123.456
3.Select a period
4.Change style of selection to some other style (ApplyTextStyle)
5. The number looks as following 456.123

What is wrong?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, there is an imperfection of bidi layout algorithm related to arranging items. By assigning a different style to the dot you make 3 items: '123', '.', '456'. When arranging items on the line, TRichView takes adjacent characters of items into account. While one of characters in the pairs ('3', '.') and ('.', '4') is a LTR character, another character (dot) is not, so TRichView arranges them according to the paragraph settings (RTL).
Solution: assign LTR to the bidimode of the text style of this number (at least to the dot).
eddy_m
Posts: 2
Joined: Sun Dec 18, 2005 4:35 pm

Post by eddy_m »

Thank you, Sergey!

I tried to evaluate your solution, but I think in our case it's too complicated to implement.

I'll try to explain the problem:

Our application must work in RTL mode. It presents textual information where any(!!!) adjacent char can have different style. Style are assigned according to specific application logic. Once information is displayed, user can modify it. Any modification can cause to a change of particular char/word/phrase style. This is the situation.
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid I cannot help right now.
In future, I plan to improve BiDi algorithm, but not in very near future.
Post Reply