gyscos/cursive

Support right-to-left languages

gyscos opened this issue · 6 comments

Some languages like Japanese and Chinese can write right-to-left (and/or top to bottom), but are fine with the usual left-to-right orientation.
Other languages like Arabic simply must be written right-to-left (I think?), so we may need some support for those.
Low priority for now, as I know next to nothing about how RTL languages are usually used on terminals.

adals commented

hello

I am native Arabic speaker if you need any help just ask me its my pleasure

Thanks!

Here are a few questions:

  • What terminal are you using? (Very interesting if someone using linux answers that.) Do you need to do anything to enable right-to-left support?
  • Is the command prompt itself right-to-left? Or individual words, for instance $ cd ARABIC_FOLDER, does the folder name itself write right-to-left?
  • With a monospace font (in the terminal), are all characters 1-cell wide (like latin alphabet), or are some 2-cells wide (like some asian alphabets)?
adals commented

sorry for the delay

What terminal are you using?
I am user for Linux Fedora and macOs
i use default terminal i can write arabic language at terminal in easy way

Do you need to do anything to enable right-to-left support?
No

Is the command prompt itself right-to-left? Or individual words, for instance $ cd ARABIC_FOLDER, does the folder name itself write right-to-left?
it shows like we read it like cd ملفاتي not like wrong way from left to right (ي ت ا ف ل م) or (م ل ف ا ت ي) all are wrong but (ملفاتي) is correct from RTL and not separated letters

With a monospace font (in the terminal), are all characters 1-cell wide (like latin alphabet), or are some 2-cells wide (like some asian alphabets)?
i dnt know how do i know?

Hmm interesting...
I am testing using gnome-terminal and konsole here.

  • In konsole, it looks like it prints the name properly:
    screenshot from 2017-08-04 12-21-56
    However, attempting to move the cursor and edit in the middle of the word causes some mess:
    screenshot from 2017-08-04 12-23-05
    Running vim gives a slightly different result:
    screenshot from 2017-08-04 12-24-07
    Running the edit example from cursive has the same result:
    screenshot from 2017-08-04 12-26-00
    Where editing the middle of the words apparently splits it in two:
    screenshot from 2017-08-04 12-26-14
    It seems to be printing ok:
    screenshot from 2017-08-04 12-26-53

  • In gnome-terminal, it's not as good:
    screenshot from 2017-08-04 12-27-57
    screenshot from 2017-08-04 12-28-34
    screenshot from 2017-08-04 12-29-41
    screenshot from 2017-08-04 12-29-47
    It doesn't split the word weirdly when I edit in the middle, mainly because it just always write it left-to-right.

So it's clear already that some terminals have really bad support (gnome-terminal), some have some support (Konsole). In both situation, cursive behaves mostly like vim.

EDIT: Actually, the "split in two" resulting from editing in the middle on Konsole is indeed cursive's fault. I'll see how this can be improved.

adals commented

hello again

i used mac os with edit example and here is the results
the first image it should be in the right side not left side and the shape for the word is perfect

screen shot 2017-08-04 at 11 04 07 pm

the second one we have edited the word from the center(by removing ف letter) and the result is not good for the dialog
screen shot 2017-08-04 at 11 04 25 pm

the third one we have edited the word from the center(by removing ل letter) and the result is good for the dialog its strange problem
screen shot 2017-08-04 at 11 05 22 pm

Hi
Now GNOME Terminal has great support for RTL languages because of VTE. And also every Terminal emulators that use VTE. The only problem that I seen, is when the Bidi is active (is not active by default and can be active by printf "\e[?2501h" command):
نماگرفت از 2022-04-07 18-48-25

The first problem is the reversed shadow. The second is reversed arrows. when I press left arow, It goes right and the same for right arow.