Re: commit (HEAD): ut_Language.h/cpp, et al.

From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Fri Apr 11 2003 - 22:09:51 EDT

  • Next message: Andrew Dunbar: "Commit: UTLANG_RTL, UTLANG_VERTICAL"

     --- Tomas Frydrych <tomas@frydrych.uklinux.net>
    wrote:
    >
    > * 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.

    I'm doing this at the moment but there is a problem
    with doing things this way. A language per se doesn't
    have a direction - a script may have one or more
    directions and a language may have one or more
    scripts.
    This won't matter for the obvious langugaes but a few
    languages in Central Asia have recently moved between
    Arabic script and either Latin or Cyrillic script and
    thus could be either LTR or RTL depending on which
    script is being used. Since AbiWord doesn't have a
    way to differentiate between which script a language
    is using at a given place within a document there is
    no way to know.
    A much more obvious problem is with Chinese, Japanese,
    and Korean - all of which are commonly written both
    horizontally and vertically.

    Why can't the characters themselved determine this?

    I'll make the changes anyway but as long as you know
    the limitations of this system now.

    Andrew Dunbar.

    > * 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

    =====
    http://linguaphile.sourceforge.net/cgi-bin/translator.pl http://www.abisource.com

    __________________________________________________
    Yahoo! Plus
    For a better Internet experience
    http://www.yahoo.co.uk/btoffer



    This archive was generated by hypermail 2.1.4 : Fri Apr 11 2003 - 22:19:51 EDT