Page 1 of 1
RightToLeft mode problem
Posted: Sun Dec 25, 2005 10:40 am
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?
Posted: Sun Dec 25, 2005 11:01 am
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).
Posted: Sun Dec 25, 2005 1:45 pm
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.
Posted: Mon Dec 26, 2005 9:31 pm
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.