Shaking effect in while writing in Arabic



  • Hello and thanks for this great project. I have an issue while writing in Arabic in RTL direction. As soon as I reach half the screen the text starts shaking. I mean like spaces would be introduced between words and as soon as I stop, those spaces are removed and the text returns to normal. It is very painful writing in Arabic. The shaking effect makes it very hard to focus. Is there any solution to this? Here is how it looks like in a Gif.

    ![https://i.postimg.cc/MZhGMwNb/yf-Dw1ojc-Mj.gif](image url)



  • Any tips are appreciated. I do not want to go “stir”-crazy.



  • @jacktoreno ,

    Sorry there has been no response. I haven’t noticed any of the “regulars” in this forum who have claimed a strong familiarity with editing Arabic script in Notepad++

    What version of Notepad++ do you have ( share ?-menu’s Debug Info via copy/paste )? Also, since most of us aren’t set up for typing Arabic, could you enter a few words in the forum? (Will it show the problem if we paste into the editor, or does it only show up as you type the individual characters and the script-joining magic is active? What about if we pasted individual characters into the editor?)



  • Thanks for taking the time to reply to my question. Here you go:

    Notepad++ v7.9.3   (64-bit)
    Build time : Feb 14 2021 - 03:15:58
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : ON
    Local Conf mode : OFF
    OS Name : Windows 7 Home Premium (64-bit) 
    OS Build : 7601.24511
    Current ANSI codepage : 1252
    Plugins : mimeTools.dll NppConverter.dll NppExport.dll 
    

    Okay. It seems this bug is (specific) text related. I tried pasting the text from the screenshot into a new file and the issue did not show. Allow me to examine my files and post the end result. Thanks again.

    Regards.



  • @PeterJones Okay here goes something (hopefully). First here is the text:

    https://www.mediafire.com/file/w2blsg5xg4nzyae/new_1.txt/file

    Please do the following:

    1. Enable Word Wrap.
    2. Use Text Direction RTL.
    3. Use the Style/Theme named “Zenburn”
    4. Drag and drop the text file above into Notepad.
    5. Click on the first line then second line (over and over) and you will see the effect.

    I hope this helps identify the issue. Please let me know if there are any further questions.



  • @jacktoreno ,

    I was able to replicate by arrowing between the two lines under those exact circumstances.

    When I switch to the default theme, it doesn’t happen. The first major difference I found was that default has Settings > Style Configurator > Global Styles > Default Style > Font = Courier New vs Zenburn using Consolas.

    Eureka! It is the fault of the font. If I change the font to Courier New (or my typical Deja Vu Sans Mono), the “shaking” redraw does not happen.

    (I tried toggling the Settings > Preferences > MISC > Use Direct Write, but that didn’t have an effect when Consolas is selected.)

    You may want to experiment with your font if you’re going to be using Arabic in Notepad++.

    BTW: thank yo very much for answering the requests for clarification and giving a detailed and easy-to-follow method of replicating your problem. It made it so much easier to solve the problem that way! :-)



  • Hmm. Interesting. Okay, I will give it a try and let you know. Thanks. Much appreciated.



  • @PeterJones Thanks a lot for all the help. Well, I went back and tried your suggestion. I went with the DirectWrite thing first and I realized it does not support Direction RTL so I disabled it.

    I have tried some fonts and I have noticed something. If I choose a font like “Consolas” then change the size to 20, the problem disappears. So, there is a correlation between font size and the issue here. The problem I am facing right now is finding a font large enough to bypass this issue, but not too large, which would be blinding. For the moment I am testing to see if “@Mircosoft JhengHei” font at (only) size 10 would solve it (at 9 the issue persists).

    What is more interesting is using Microsoft Notepad, I do not face this issue. Too bad I am using Windows 7, so I cannot have dark more or something. I will report my findings after some font testings. Thanks again.



  • @jacktoreno said in Shaking effect in while writing in Arabic:

    What is more interesting is using Microsoft Notepad, I do not face this issue.

    This is probably where Peter starts describing how fonts in Windows truly work. :-)

    Too bad I am using Windows 7, so I cannot have dark more or something

    Do you mean “dark mode”?
    If so, how is that related to the “shaking” that is the topic of this thread?
    Also, even if you had Win10, N++ doesn’t currently support “dark mode”.

    You can certainly report all you find out here, but be advised that Notepad++ itself doesn’t control much of what you’re likely seeing, so it is likely there isn’t much if anything it can do about it.



  • Thanks for the help. I wanted an alternative to Notepad that supports dark theme. I tried VSCode but it has no RTL support. I tried other products and they always had annoying issues that I could not solve.

    I have been trying all fonts and I think the following that support most (if not all) font sizes. Hopefully, they will help anyone facing the same problem:

    Microsoft Sans Serif
    Microsoft JhengHei
    Lao UI
    Kalinga
    Plantagenet Cherokee
    Palatino Linotype
    Georgia
    Courier New
    Constantina
    

    There are also fonts that support some of the font sizes that are worth mentioning. They still have the shaking issue on some of the font sizes:

    Microsoft YaHei
    Microsoft Tai Le
    Microsoft New Tai Lue
    Khmer UI
    High Tower Text
    

    P.S. Can I suggest storing the Direction (RTL or LTR) option so it can be used on next launch? Better yet, maybe Notepad++ can autodetect the language and auto switch. Thanks.



  • @jacktoreno said in Shaking effect in while writing in Arabic:

    Can I suggest storing the Direction (RTL or LTR) option so it can be used on next launch?

    Good idea. It would probably be nice to save it on a per-file basis in the session.xml , and/or have a setting in preferences, something like

    Text Direction: 
        ⦿ Remember LTR or RTL per-file basis
        ◯ Assume LTR on all opened files
        ◯ Assume RTL on all opened files
    

    But if per-file isn’t possible, then having the preferences store the setting from the View menu selection would be nice

    Text Direction: 
        ◯ LTR
        ◯ RTL
    

    Better yet, maybe Notepad++ can autodetect the language and auto switch.

    That sounds like a practical idea – but a quick search on this forum for the autodetect of encoding will show you that “autodetect” can often be worse than not trying to guess. If a file uses one of the 256-character “character set” encodings, it’s virtually impossible to differentiate; if the file uses UTF-8, UCS-2, or another full-Unicode encoding, then there might be a chance by seeing if it’s all (or mostly) using Arabic or Hebrew codepoints – or other scripts that go in RTL – but that autodetect may be less trivial than my description implies.

    FYI: We have a FAQ which explains where official feature requests should go. Until someone (like you) follows those instructions and puts the feature request in the official tracking location, it won’t be tracked and will not be implemented.



  • Thanks for the information and suggestion.



  • I have decided to add the suggestion and reference it here:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9665



  • @PeterJones Hello Peter, I just wanted to thank you again regarding the help with the issue here. I have been enjoying NP++ for a week now without any issues. No more dancing letters.


Log in to reply