Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: add support for right-to-left languages #2953

Open
Anonymous2716 opened this issue Aug 23, 2022 · 24 comments
Open

[Feature]: add support for right-to-left languages #2953

Anonymous2716 opened this issue Aug 23, 2022 · 24 comments

Comments

@Anonymous2716
Copy link

Anonymous2716 commented Aug 23, 2022

Feature description

This works on any input field and in the slide on extra keys too. But not in the actual terminal . the charecters gets individually displayed instead of merged into a word. Don't know if it is possible bcs its a terminal not an usual text input field.

Example :
Screenshot_20220824-023344

Additional information

This would help a lot . cant text edit or write this kinda languages in termux terminal.also left to right, right to left directions.

@ChiefMikeK
Copy link

ChiefMikeK commented Aug 26, 2022

A possible font problem?
I can display non-english characters but, I think that you are confusing this with Unicode Combining Characters not displaying correctly?

please post which font your using and type the actual text here and not only a screen-shot

@Anonymous2716
Copy link
Author

@ChiefMikeK androids default fonts. And yeah maybe you are right Unicode combining characters. BTW I showed an example . the same text is written in the terminal and right above the keyboard . here صباح الخير and I can show you other languages if you need.

@ChiefMikeK
Copy link

الخير

صباح


These 2words do not have any combining characters possibly? related to harfbuzz as i've tred diff fonts.

@Anonymous2716
Copy link
Author

Anonymous2716 commented Aug 26, 2022

@ChiefMikeK when they are written without space the characters gets combined into الخير but individually they are ا ل خ ي ر .btw this language writes right to left . but in terminal they gets as English left to right.

@sylirre
Copy link
Member

sylirre commented Aug 26, 2022

Termux doesn't really support right-to-left languages. More issues related to this one:

@sylirre sylirre changed the title [Feature]: support for displaying non-english language charecters. [Feature]: add support for right-to-left languages Aug 26, 2022
@mablue
Copy link

mablue commented Sep 18, 2022

Screenshot_2022-09-18-19-19-58-895_com termux
The true thing will shown:
"سلام سلام خداحافظ خداحافظ گوگولی مگولی :)"
(Still the smily face is in wrong direction cuz of html roles. But you can see the best result in this picture:
Screenshot_2022-09-30-08-26-35-739_com google android apps messaging

@mablue
Copy link

mablue commented Sep 18, 2022

Should fix with this method:
https://bugzilla.xfce.org/show_bug.cgi?id=12576

@MatanZ
Copy link

MatanZ commented Sep 20, 2022

If anyone wants to test bidi support, you can try my branch: https://github.com/MatanZ/termux-app/tree/bidi1

@mablue
Copy link

mablue commented Sep 30, 2022

If anyone wants to test bidi support, you can try my branch: https://github.com/MatanZ/termux-app/tree/bidi1

Thanks It's fucking good news.🎉 But We have no compilers
Just merge it to mainstream branch and wait to see your updates on f-droid
It's not a simple update if you fixed working with RTL languages It will be merged.

@ghost
Copy link

ghost commented Oct 4, 2022

If anyone wants to test bidi support, you can try my branch: MatanZ/termux-app@bidi1

@MatanZ i tested it, it works, but it made the app so slow and the font is a bit off
Screenshot_20221004-182659_Termux

@Anonymous2716
Copy link
Author

@elwaer-m I can't build right now. Can you share the apk?

@ghost
Copy link

ghost commented Oct 4, 2022

@mablue
Copy link

mablue commented Oct 4, 2022

Wow amazing 😍 we need it in iran too for persian typing
But why first character bigger than others??🤦🏻😑
Also why my termux have not colorfull like that? Please make termux more stylish too.
IMG_20221004_200956

@Anonymous2716
Copy link
Author

@elwaer-m before you say slow keep in mind that they are all debug builds. Build a release version and then try it.

@ghost
Copy link

ghost commented Oct 4, 2022

@elwaer-m before you say slow keep in mind that they are all debug builds. Build a release version and then try it.

they are the same thing lol

@MatanZ
Copy link

MatanZ commented Oct 4, 2022

If anyone wants to test bidi support, you can try my branch: MatanZ/termux-app@bidi1

@MatanZ i tested it, it works, but it made the app so slow and the font is a bit off Screenshot_20221004-182659_Termux

Is the Arabic font you use monospace? If it is not, then termux stretches thin letters, which may explain the weirdness. It is possible to avoid stretching, but then the letters will not connect. The best is to use a monospace font. Please note that even if you use a monospace font, the Arabic letters might come from a different font, and thus not be monospace.

About the slowness - I did not notice this, and my phone is quite slow (MT6753). I also do not see much reason for it since:

  1. The shaping/reordering code is not very slow, and it only needs to run 60 times a second.
  2. It runs only on lines that include Arabic/Hebrew letters, so for most lines there is no change.

Possibly the commit
MatanZ@51c4ac2 is the problem, so you can try to revert it and rebuild.

@ghost
Copy link

ghost commented Oct 4, 2022

Possibly the commit
MatanZ/termux-app@51c4ac2 is the problem, so you can try to revert it and rebuild.

yes after disabling the logging the issue solved!

Is the Arabic font you use monospace? If it is not, then termux stretches thin letters, which may explain the weirdness. It is possible to avoid stretching, but then the letters will not connect. The best is to use a monospace font. Please note that even if you use a monospace font, the Arabic letters might come from a different font, and thus not be monospace.

even with a monospaced arabic font (https://makkuk.com/kawkab-mono/) it still the same "the first letter is big"

Screenshot_20221004-215256_Termux

@MatanZ
Copy link

MatanZ commented Oct 4, 2022

I do not read Arabic well enough. Please include the same text in text format, so I may work on this. Also a correct rendering in the same font (from a browser, or something like that. If you have the patience to mark the meaningful mis-rendering, it will be even better.

@ghost
Copy link

ghost commented Oct 4, 2022

some samples:
السلام عليكم
صباح الخير
شمس قمر
سماء أرض
ماء نار هواء
شروق غروب
a monospaced arabic font

If you have the patience to mark the meaningful mis-rendering, it will be even better.

Screenshot_20221005-013110_Termux

most the render problems is oh the letter ا
and when ر and و are together رو

@mablue
Copy link

mablue commented Oct 5, 2022

This is not our problem (not nessesery to solve too) (also not bidi problem) we have problem on orginal termux. And will work on it. Also when the word is not selected it deferent with when its selected(I name it: end character shooting problem 🎉ECSP🎉 ):

@agnostic-apollo
Copy link
Member

The font thickness issues may be somehow related to #2539

@ghost
Copy link

ghost commented Oct 5, 2022

The font thickness issues may be somehow related to #2539

maybe it is? i tested it on a samsung phone

@ChiefMikeK
Copy link

I tried a few fonts from termux styles and GNU FreeFont was the only one found that displayed correctly from right margin and also did not embolden the ARABIC ALEF U+0627

ltr-samples

@alprofmahmoud
Copy link

Please
What should I do to get installed bidi?
It is not clear what is required in #2953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants