Mikescher/AlephNote

Text Editor behaves strange editing Chinese Text when word wrap is enabled.

Opened this issue · 6 comments

Turning on word wrap.
When typing English everything works fine.
When typing Chinese Text everything behaves awful,
Can it be fixed?
Thanks a lot!

I'm not familiar with C# programming. This may have something to do with the property of the textedit control.

Hmm, what problems are you experiencing exacly, if I paste a bit of chinese text into AN and enable word wrap everything seems to behave ok.
I'm using Scintilla as my editor control and don't have too much control over such low level text rendering properties, but Scintilla is widely used control (eg in Notepad++) and I don't know of any problems it has with unicode text.

Steps to repeat the problem:

  1. Enable word wrap
  2. TYPE or paste a paragraph of Chinese text,like this:
    实践中,网店遇到此种情形,可能会抗辩认为消费者应该对商品价格有一定认知,标价错误的商品价格并非网店真实意思表示,是输入错误,且标注的价格与实际价格存在巨大的差异。但对网络销售而言,此种非面对面的交易与传统的交易模式不同,在网络销售中,不乏有由于促销活动,如特惠、打折或秒杀而产生的极为低价的商品。康健认为:“这正是网购吸引消费者的原因之一,故不能仅以价格差距判断合同成立的合法性。”
  3. Put the cursor in the middle of the paragraph
  4. Type some spaces
  5. Then you can see the problem
    image

I tried notepad++, it has the same problem.
Obviously, it's the problem of Scintilla
image

I google "notepad++ chinese word warp", i found this:
https://sourceforge.net/p/notepad-plus/discussion/331754/thread/7a813af6/

image
Don't sure if this will help!
Anyway, thanks for you great work on AlephNote, it's a great software.

After reading this link: notepad-plus-plus/notepad-plus-plus#5524
It looks like Scintilla has problems in word-wrap multiple languages.
Is there any possibilities that AN use some other controls rather than Scintilla as text edit control, such as wpf official text edit control. Or just give user an option to choose between controls.
Just an idea, LoL
Thanks again for your greak work.

Or just give user an option to choose between controls.

While that would be possible the Scintilla component is pretty central in the application and I would need to do quite a bit of rewriting to support a completely different component (also the original reason to use scintilla was that it is way more powerful than the wpf textbox).
If someone wants to do the works and abstract the editor to support different controls I would definitely consider PR's (perhaps open a new issue to talk a bit about the general design). But I don't think I will be doing that on my own in the near future, sorry