From: Tomas Frydrych (tomas@frydrych.uklinux.net)
Date: Fri Apr 11 2003 - 09:12:52 EDT
* ut_Language.h/cpp:
I added a new field called 'order' to the language data, with
possible values UTLANG_LTR, UTLANG_RTL, UTLANG_VERTICAL, and a new
member function getOrderFromProperty(). I have filled everything in
the table with UTLANG_LTR, except for the two Arabic dialects, Hebrew
and Yiddish, which I set to UTLANG_RTL. I would appreciate if some
linguaphile (Andrew?) could go over the table and change the values
to RTL and VERTICAL anywhere else where that is appropriate.
* ap_EditMethods.cpp/xap_Prefs_SchemesId.h:
I added a new edit method 'insertClosingParenthesis', which will be
bound to characters ')', ']' and '}' instead of 'insertData'. This
method works in combination with a new XAP preference
DirMarkerAfterClosingParenthesis, and the already existing XAP
preference ChangeLanguageWithKeyboard.
If either preference is set to 0 (default for
DirMarkerAfterClosingParenthesis) it behaves in a manner identical to
'inputData'. If the preferences are set to 1, the new method examines
the language property at the insertion point and after inserting the
character data it inserts a direction marker LRM (u200e) or RLM
(u200f) based on the language.
This new mechanism provides handling of parenthesis similar to that
of MS Word, which is much more intuitive than that provided by the
raw Unicode bidi algorithm. Just to illustrate what this is about, if
the following text (caps are RTL characters) is input
"A log(k) B"
the Unicode algorithm will resolve this to visual order
"B (log(k A"
However, the user most likely wants
"B log(k) A"
which is what s/he would get in Word automatically. The solution is
for the user to insert a left to right marker (LRM) after the closing
parenthesis. Unfortunately, the problem only becomes obvious when the
'B' is entered, and fixing it, therefore, requires (a) an
understanding of what the cause is, which is not obvious, (b) moving
insertion point backwards behind the parenthesis, (c) inserting a
suitable direction marker, (d) moving back to the original insertion
point. In contrast, the new method will insert the correct marker at
the same time the parenthesis is closed.
For now it is only the Win32 users that will be able to take
advantage of this, until the other platforms can translate keyboard
layout changes to changes of language (as controlled by the XAP
preference ChangeLanguageWithKeyboard).
Tomas
This archive was generated by hypermail 2.1.4 : Fri Apr 11 2003 - 09:23:45 EDT