Open wada3n opened 4 years ago
How can I test this out for myself? I am English-speaking only and have the corresponding qwerty keyboard, for context.
You can try it by adding an Arabic keyboard layout from ‘System Settings’->Click ‘Keyboard’ -> Click ‘+’ on the bottom left of the ‘Layout’ tab. -> Search for Arabic -> choose one and click ‘Add Layout’. Then choose this added layout and press any keys on the keyboard to add just meaningless words.
Or you can make a copy and paste from this list and try it directly in the canvas: مرحبا السلام عليكم أهلا وسهلا كيف الحال
Okay, I am able to reproduce the issue.
Out of curiosity, I noticed that using the left arrow key (when editing the Arabic text) causes the cursor to move to the right and the right arrow key causes the cursor to move to the left. Is that the expected behavior for RTL text editing? Seems that I should be detecting what type of text was entered in the node and adjust the key events to work appropriately.
The Normal behavior, when you press the right arrow key it moves to the right and when you press the left arrow key it moves to the left. In fact, this is a general issue in right-to-left text editing, so you find a lot of software (such as LibreOffice) that creates a feature for editing RTL texts and changing its own behavior. But in general, I think GTK applications have solved this problem You can try Code and Files in Elementary os and you will find that normal behavior is used. I will try to find out more about it, I have to find an easy solution, and tell you
هل يمكنك مساعدتنا لو تكرمت هنا أخي @bilelmoussaoui can you help us here?
I think it is generally related to “halign” property. in gtk_widget_set_halign () and GTK_ALIGN_START and GTK_ALIGN_END Where you control the texts in GTK: https://valadoc.org/gtk+-3.0/Gtk.Align.html
Waiting for the opinion and assistance of developer @bilelmoussaoui, personally, I am not a gtk developer, and I do not know enough about that, so excuse me if I make a mistake.
The text in Minder nodes is not rendered in a widget. It is drawn via Cairo and Pango, so halign is not useful here.
I will have to give the solution some thought. A new version of Minder will be released very soon, but it will not contain the fix for this issue.
I have fixed the issue of drawing the RTL text within a node in the devel branch. This will be generally available in the next stable release.
I do not have support for proper cursor movement when text is within RTL text (left moves the cursor right and right moves the cursor left). I won't be able to fix this until elementary OS uses the latest GTK/GDK library which contains the method I will need to implement this fix.
This is awesome, it works just as it should. In fact there has been a significant improvement over recent changes with the handling of texts. Thank you very much for the enormous effort you are making, waiting for the new version of elementary OS!
There is a small issue while writing in the nodes or connections in Arabic, for example, or Right to Left texts in general, Where the text comes out of the writing box frame. The best solution is to make the beginning of the text the rightmost corner of the box, and the more you type, the larger the box.