Question about less-than and greater-than in Arabic

Khaled Hosny khaledhosny at eglug.org
Mon Mar 19 07:20:10 PDT 2012


Hi Kendy,

On Mon, Mar 19, 2012 at 09:51:24AM +0100, Jan Holesovsky wrote:
> Hi Khaled,
> 
> I've got the following report:
> 
> ----- 8< -----
> The Arabic keyboard layout in X11 has the less-than sign (<) on the same
> position as the left curly bracket ({) in the English keyboard layout.
> Same for > and }. If I type in the terminal, these two display as
> printed on the Arabic keyboard. However, in both LibreOffice and gedit,
> which support RTL, the < and > signs are swapped. So when I type 1<2, it
> displays 2>1 aligned to right. I guess that someone has made the effort
> to swap the symbols and this is the intended behaviour and that users
> expect this. But I would be very grateful if some native speaker could
> confirm this.
> 
> Please see the attached screenshot, showing the string "1<2" entered
> into the gnome-terminal, gedit and LibreOffice.
> ----- 8< ----
> 
> Can you please help me to understand what is the correct, expected
> behavior? :-)

Less than and greater than have the Unicode Bidi_Mirrored property which
means that a Unicode complaint application should mirror them if the
direction of text run is right to left (which is the right thing to do
since the base of greater than faces the first value, which is the right
one in case of Arabic, and vice versa), so LibreOffice and Gedit are
doing the right thing here, but the terminal does not seem to support
right to left and does no mirroring.

BTW, just "1<2" are not enough to determine the directionality since all
the three characters have weak direction property, so some application
will guess the direction from the language of the keyborad layout
currently active (very visible in Gedit, type 1<2 with Arabic and
English layouts and watch the difference though they are exactly the
same 3 characters).

On my Arabic keyboard, the printed less than and greater than symbols
match the "mirrored" form, and all the keyboards I've seen do the same,
and it matches MS's Arabic layout (I know because I submitted a patch
long ago to XkeyboardConfig that swaps the positron of all mirrored
characters in the Arabic layout so it matches user expectations).

Regards,
 Khaled


More information about the LibreOffice mailing list