[Lazarus] [BIDI] TGrid and many bugs if i add Right To Left

Zaher Dirkey parmaja at gmail.com
Mon Apr 12 13:16:37 CEST 2010


2010/4/12 ik <idokan at gmail.com>

> <http://ik.homelinux.org/>
>
> Let's seperate things into two groups:
> 1. Text
> 2. UI
>

Yes, UI more easy than Text, but drawing text done by API in GTK2/Cairo and
QT, and it must implemented in widgetset of GTK2/QT.


>
> For text, both Qt and GTK 2x support right to left languages. When there
> are also non right to left chars (such as "arabic numbers" [the number used
> in the arabic language are actually hindu numbers :)], and latin letters
> etc) .
>
> Even on non BiDi system, you can write right to left languages. The problem
> starts when you need to use non Right To Left chars inside a Right To Left
> paragraph, or the other way around, when you have a Left To Right language
> and you add there Right To Left chars. That called Bi-Directional or BiDi
> for short. You have a full algorithm description for it in unicode,org (
> http://www.unicode.org/reports/tr9/), including FAQ on the matter (
> http://www.unicode.org/faq/bidi.html).
>
> One more sophisticated problem in BiDi is the Arabic language. Many letters
> in the Arabic language have several ways to be presented, because the Arabic
> written language combine all (almost) letters like the lattin script
> language. So Letters that at the beginning, middle or end of a word (depends
> on few other rules) are different letter shapes.
>
>

> My native language -> Hebrew does not have this problem at all.
>
> You have in the Open Source few implementation of BiDi support such as
> FreeBiDi, and the IBM's unicode library, but also with GTK2 and Qt3 and
> above.
>
>
Arabic language have this rules, but it is easy that Japanese/Chinese
languages :)

Drawing this text must done by the system or there is functions to calc the
bidi of utf text founded in FPC
fpc\src\rtl\objpas\utf8bidi.pp if you want to draw in utf8 with system that
not support right to left text like SDL.



> The Right To Left UI, is a whole different approach that actually everyone
> here can help with. On Latin based languages, everything starts from Left To
> Right, on Right To Left UI, everything starts from the Right.
>
>
It is like see the control through the mirror.


> So point 0,0 on Latin bases system should be on the top left, and on the
> Right to left languages starts from the top right.
>

No (0,0) it must still start from Top Left like Windows


> Some UI such as GTK2 (up to a point, it does not support all of what we
> require in Lazarus) support it, and so does Qt, and Windows API (on a
> native/enabled/unicode versions).
>
> In Windows many control not support Right To Left, and still have bugs in
Menu, TreeView.

But, we can use a native control that support Right To Left for Like
TVirtualTreeView for example.

Best Regards
-- 
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100412/8dfc348f/attachment-0004.html>


More information about the Lazarus mailing list