For RTL locales, our current layout of omnibox and textfield are
left-to-right, which is not right, and there are 5 bugs related to this
wrong layout (issue 6101 <http://crbug.com/6101>, 6106<http://crbug.com/6106>,
6108 <http://crbug.com/6108>, 6082 <http://crbug.com/6082>, and
10931<http://crbug.com/10931>
).
I am trying to change the layout of omnibox and textfield to be
right-to-left using WS_EX_LAYOUTRTL instead of WS_EX_LAYOUTRTL |
WS_EX_RTLREADING.
But I am stuck on an issue: how to display the English parentheses
correctly in RTL CRichEditCtrl.
Following is how the parenthesis should be displayed in RTL context (which
matches how parenthesis is handled in HTML).
"In RTL directionality however, unless surrounded by LTR characters on both
sides, U+0028 is displayed as ")". The closing parenthesis, U+0029, is also
mirrored in this way, as are a whole bunch of other characters, including
all the brackets."
Which means, the English parenthesis need to be correctly mirrored, and it
could be changed while typing (depends on the surrounding characters, U+0028
might be ")" or "(").
Looks like CRichEditCtrl handles Hebrew parenthesis correctly (when IME is
set as Hebrew), but it does not handle English parenthesis correctly. In
English IME, U+0028 is always displayed as "(". For example, the following
characters (in logical sequence) "abc(ABC" (where "ABC" represents Hebrew
characters) will be displayed as "CBAabc(" in RTL CRichEditCtrl, instead of
"CBA)abc"
I did not figure out whether CRichEditCtrl has any option to make the RTL
CRichEditCtrl to work correctly for parenthesis as that of RTL html page.
My questions are:
1. Do you know whether there is any flag in CRichEditCtrl to handle those
opening/closing punctuations correctly ?
Looks like RTL CRichEditCtrl does not treat punctuation the same way as HTML
does, for example, "Yahoo!" should be displayed as "!Yahoo" in RTL context,
but it is displayed as "Yahoo!" in RTL CRichEditCtrl.
2. If CRichEditCtrl does not support this out of the box, we can do the
dirty and hard work to make it work. It wont be easy since we need to handle
all kinds of opening/closing punctuations, and we need back-trace to change
the punctuation depending on the surrounding characters (for example, after
"abc", U+0028 will be displayed as ")", but if we type in "d", ")" need to
be changed to "(".), and we might need some states-saving as well. I think
the performance in textfield and omnibox will be degraded a lot by those. Is
there any better way?
Would appreciate any input!
Thanks,
Xiaomei
--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---