Notepad++ in Right-To-Left (RTL) mode
-
I’m forking this from the Horizontal Caret thread as it’s a separate thread.
@JamesWebb said:
I have a question about selecting words in RTL. Whenever I try to select a word or words, if the line is left-aligned, the selection appears like a rolling film strip, making it difficult for me to see which word I’m selecting. However, if the line is right-aligned, the selection works normally, and I can see which word I’m selecting:
https://mega.nz/file/R9YTASzC#cwWjdDfJG5XRGsqfUWrTuJBfF_iDPKA3NX_Oac9O5RM
Do you know why NP++ has such odd behaviour? Is there any solution?
Notepad++'s RTL mode seems to be quite buggy. I tried it and what I see happening is so strange I can only describe it in general terms.
For those that want to experiment with this,
Ctrl+Alt+R
will switch to Right-To-Left (RTL) mode andCtrl+Alt+L
will switch to Left-To-Right (LTR) mode. For those that use DirectWrite mode you will get a pop-up about needing to disable it and to restart Notepad++.In RTL mode I first tried double clicking on words to select them. Sometimes notepad creates multiple selections, sometimes it’s one selection, the size and placement of the selection(s) is consistent for any given word on the page that I double click but I can’t see the relationship between what I double clicked and the resulting selection(s).
If I drag-select from by holding the mouse button down while moving the mouse either left to right or right to left. It starts out looking ok but then Notepad++ rearranges the letters on the current line. The file-modified flag does not come on. If you keep dragging or, release and click the mouse button the text is again rearranged to normal text.
This behavior exists in version 8.6 and older versions such as 8.3.3 of Notepad++.
-
Some changes have recently been made to RTL mode.
I’m not sure (and haven’t bothered to look) if those changes made it into 8.6 or will be in the next release.What I do know is that a heavy user of RTL mode has disliked the changes so much that he has chastised the Notepad++ developer in no uncertain terms. What makes this so odd and notable is that this user had to that point been infinitely polite in his comments for many many years. This user has stopped making comments and suggestions and in all likelihood has moved on to using a different text editor…and that’s a shame.
I think that to really understand RTL mode, one has to be versed in a right-to-left language. Without this, it is like a 100% English speaker commenting on the interesting nuances of the German language – it can be done, but do you really understand what you are commenting on?
I’m one that has no appreciation for a RTL language or RTL mode, so that is the extent to which I can comment (thus, I’m done).
-
@Alan-Kilborn said in Notepad++ in Right-To-Left (RTL) mode:
I think that to really understand RTL mode, one has to be versed in a right-to-left language.
RTL is just a display orientation: the graphics device takes the x and y parameters of LTR display and inverts them.
The real trouble comes from bi-directional display. Most documents, regardless of language, are going to have a mixture of typographies. Web browsers and MS Word can easily handle this because both are essentially X/HTML markup renderers (the
*.docx
format is basically HTML); thus the display format and the textual content are both provided by the input file.Plain text editors operate on byte streams. Scintilla containers have a bit more to work with, as every incoming byte will be “decorated with changing light-weight indicators” (*1), but nothing to indicate how the content bytes should be oriented on the screen.
This remains an issue even with Scintilla editors that closely follow upstream development (by virtue of being maintained by one of Scintilla’s core contributors), like Notepad2: https://github.com/zufuliu/notepad2/issues/392
(*1) https://sourceforge.net/p/scintilla/feature-requests/1505/#5e72
-
@mkupper The Introduction to the official Scintilla documentation states:
Scintilla provides only limited experimental support on Windows for right-to-left languages like Arabic and Hebrew. While text in these languages may appear correct, interaction with this text may not work correctly as occurs with other editors.
Searching turns up a few mentions of right-to-left text handling changes in Scintilla, but on the whole it appears the developers/maintainers have never prioritized RTL as something worth implementing. So most likely neither Notepad++ nor any other Scintilla-based editor is going to do this well anytime soon.
I didn’t find any Windows text editors that claim to support RTL fully by searching in English. Perhaps someone who knows an RTL language would have better luck searching in that language.
-
When I said:
I think that to really understand RTL mode, one has to be versed in a right-to-left language.
@rdipardo followed up with:
RTL is just a display orientation: the graphics device takes the x and y parameters of LTR display and inverts them.
Just that is fairly easy to understand. But I was meaning “in the context of text editing a document applying RTL”.
@Coises points out from the docs:
While text in these languages may appear correct, interaction with this text may not work correctly
which is what I was getting at with my original comments – there’s more to it (the editing experience) than “just a display orientation”.
-
@mkupper said in Notepad++ in Right-To-Left (RTL) mode:
I’m forking this from the Horizontal Caret thread as it’s a separate thread.
Thank you for your previous efforts. I wanted to let you know that Microsoft has recently added the NP (native Windows Notepad) option to the right-click context menu in Windows 11, which is the operating system I currently use. This feature works perfectly for me, and I no longer need to use NP++ anymore.
https://mega.nz/file/1sAzCSKS#AzwlsDw_DpHvUJvIpLKF3BVzmgd0kbHTfnRLKwz10Pk
I also wanted to express my gratitude for your previous assistance. While it may not have resulted in a solution for my specific issue, it did help me understand a new aspect of racism. Thank you for that 😉.
-
@JamesWebb said in Notepad++ in Right-To-Left (RTL) mode:
I also wanted to express my gratitude for your previous assistance. While it may not have resulted in a solution for my specific issue, it did help me understand a new aspect of racism. Thank you for that 😉.
Looking at the Horizontal Caret discussion, I cannot see anything in that conversation that appears to me to be racist, overtly or otherwise, by @mkupper or any of the other participants. If you are saying that there was something racist there, please private-message me or one of the other admins in the forum with an explanation.
If you are trying to say that the developer’s unwillingness and/or inabilty to do a reasonable implementation of RTL is evidence of his racism, then you and I have a wildly different interpretation as to the root cause.
-
@JamesWebb said in Notepad++ in Right-To-Left (RTL) mode:
it did help me understand a new aspect of racism
You are correct. Unfortunately, implementing better RTL support in applications such as Notepad++ means that time and/or bandwidth would need to be taken away from other potential improvements.
The hope in the open source world though is that people, including those from RTL cultures, can become part of the solution.
We tend to count in decimal. Cultures that count in base twelve or anything other than ten are excluded. Notepad++ has the CustomLineNumber plugin but that only supports people who count starting at zero and people who think in hexadecimal. People who think in octal or base 12 are still seeking an editor where they can feel at home.
Likewise, we tend to count up, one, two, three, four, etc. Cultures that count some other way, such as sideways, are excluded.
That’s what happened here. Computer memory ended up being organized from lowest to highest as that’s how people involved in the design and building of the earliest computers were used to counting. Top down stacks are regarded as “backwards.”
When television was invented a decision was made that the scans be from the top of the screen down and from the left edge to the right. Television cameras also scanned from top down and left to right, sending the resulting serial data stream to television display units. This orientation seems to be have been a personal preference as they easily could have used bottom up and/or right to left scanning to build the same image.
Video display units for computers contain a small section of memory which is read from lowest to highest address and which was aligned with the top down and left to right scanning of television display units. Cultures with other orientations or ways of counting ended up getting excluded.
Another issue is there is a human trend to push technology to its limits and to expect the best available performance. At present display units tout 8K Ultra HD technology. That’s great but it leaves little available bandwidth to handle transposition of lines or rows on the fly to natively display text that is not left-to-right and then top-down. Thus while we could have better support for RTL or Asian top-down and then right-to-left text it will impact performance. Keep in mind that while something like Notepad++ looks like text it’s a graphical display. The display needs to be redrawn as the cursor, text, and elements such as dialog boxes are added or moved. The redrawing is optimized for top/down left-to-right displays implemented internally using CPU and GPUs that both have a built in designs for low to high orientation. Look up burst mode which is designed around low to high counting. Working through memory backwards to support RTL means we won’t be able to take advantage of a CPU’s “natural” low to high logic nor the underlying burst mode logic.
We are surrounded by structural racism and/or discrimination.
-
I didn’t mean you said something racist. I am thankful that your other posts (on my other thread, asking about horizontal caret) taught me a little about open-source in 2-3 lines.
I said in this thread I noticed a bit smelling racism. Maybe I’m wrong! Maybe it’s because I’m a good friend of dogs (especially GS) and also cats, and we are best friends for each other. And living with them taught my unconcious smelling sense to be very sensitive!
I am old enough to understand nobody is in debt with me! I just asked a “Question” and got my reply. I learned not to behave binary! Instead, I’m trying to follow the fuzzy logic in my thoughts!
BTW, you are talking about an interlaced (European, Philips) system. How about the Bravia (Sony) Progressive system? 😁
@mkupper said in Notepad++ in Right-To-Left (RTL) mode:
We are surrounded by structural racism and/or discrimination.
Reply
Apology. But I’m not agree. 😉
-
@mkupper said in Notepad++ in Right-To-Left (RTL) mode:
Keep in mind that while something like Notepad++ looks like text it’s a graphical display.
This really is the heart of the issue. What the end-user sees in the edit window gets there by a system-dependant pipeline that starts by loading the font file, mapping a character to physical keystrokes (or IME input), measuring the size of the client area to be filled by the character, drawing it, then recomposing the client area all over again by shifting every other character that was already there. By that point, we are as far removed from Scintilla and Notepad++ as this conversation has come.
Text direction is entirely up to the graphics device, which varies widely across platforms, and Scintilla has to maintain support for 3 of them (maybe 4, if we include Qt, which is really just an obsessively object-oriented wrapper atop the C-language libraries underpinning the given operating system). Worse, Notepad++ has always used the oldest, most backward-compatible APIs the Windows platform has to offer, and legacy GDI’s concept of RTL is literally a geometric flip called “mirroring”: https://learn.microsoft.com/en-us/globalization/localizability/mirroring-in-win32
@JamesWebb said in Notepad++ in Right-To-Left (RTL) mode:
@mkupper said in Notepad++ in Right-To-Left (RTL) mode:
We are surrounded by structural racism and/or discrimination.
Reply
Apology. But I’m not agree. 😉
I think @mkupper was talking more about 30 years ago, when, for example, the GDI interface was written, by American engineers, who obviously didn’t care enough about international users to bother writing APIs that could properly draw “foreign” languages. Their design choices actually do prejudice the user experience of Persian, Arabic and Hebrew speakers. But nobody on this forum can do anything about that, or needs to apologize for it.
There is no shortage of word processing software that can intelligently produce text in a variety of international languages. Notepad++ is currently not one of them.