jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.5k stars 744 forks source link

How to support non-English typing in textbox in Snap? #1047

Closed gengshenghong closed 5 years ago

gengshenghong commented 8 years ago

Is it possible to enable multiple-byte input in SNAP? Example: Input Chinese for the "Project Notes". It seems all Chinese input will be ignored by snap.

After searching on internet, it seems this is an issue for HTML5 canvas-based input box. It is discusses in below thread (which already fixed the issue, though it seems like still not working from my test...)

https://github.com/kangax/fabric.js/issues/2051

Any idea whether it is possible to fix in snap? If yes, how? Appreciate if you have any idea to share.

Thanks, Shenghong

gengshenghong commented 8 years ago

Another thread discussed about the same issue: http://stackoverflow.com/questions/21372051/fabricjs-itext-is-support-unicode-hangeul-not-moified/24205247#24205247

The demo provided there works for me in my test.

Thanks, Shenghong

gengshenghong commented 8 years ago

anyone has an idea? This issue should affect all non-English input method.

Basically, I saw 2 fix from what I learnt from Internet.

  1. implement the canvas input box supporting multiple-byte input method (like Chinese). Example: https://github.com/goldfire/CanvasInput
  2. Have a HTML on the canvas input box The issue for this solution is that we need to know the position of the canvas input morph, I have no idea how to get the absolute position in Morph.js.

Thanks, Shenghong

jmoenig commented 5 years ago

IME support has now been introduced with https://github.com/jmoenig/Snap/releases/tag/v5.0.6