pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.2k stars 356 forks source link

Chinese characters cannot input in Pharo #8661

Open liangbing64 opened 3 years ago

liangbing64 commented 3 years ago

Describe the bug Latest Image 1168 and VM. There is no Chinese character input prompter box.

Pharo 80 Chinese character input works fine. Use 80X64 VM to open Pharo 90. Chinese character input prompter box can open , but input and diplay incorrectly Maybe this is VM error.

To Reproduce Steps to reproduce the behavior:

  1. Shift Chinese input state
  2. input strings in text pane
  3. no Chinese input prompter

Expected behavior Chinese input prompter appear

Screenshots image

Version information:

welcome[bot] commented 3 years ago

Thanks for opening your first issue! Please check the CONTRIBUTING documents for some tips about which information should be provided. You can find information of how to do a Pull Request here: https://github.com/pharo-project/pharo/wiki/Contribute-a-fix-to-Pharo

GitHub
pharo-project/pharo
Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk. - pharo-project/pharo
guillep commented 3 years ago

Hi @liangbing64 ,

the windowing system has been moved from the VM to a normal pharo library in Pharo9. This is probably a side effect of that move. In the past weeks I've started playing with IME support too, there is an ongoing discussion on discord, I invite you to take a look and comment in here: https://discord.com/channels/223421264751099906/582493455574499348/821013293215907904

Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
liangbing64 commented 3 years ago

I use OpenSmalltalk Pharo VM(stable)to run Pharo 9 and 10,the result is Chinese input prompter can display and work , but backspace key doesnot work.

shixiongfei commented 2 years ago

Is there any new progress on this issue? I have the same problem with Pharo90 and Pharo100.

Ducasse commented 2 years ago

@guillep

guillep commented 2 years ago

IME support is still work in progress in: https://github.com/tomooda/PharoIM I know @tomooda has done some progress on that front. You can help checking the code there, testing it, or improving it.

GitHub
GitHub - tomooda/PharoIM: InputMethod support for Pharo on headless VMs
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.
liangbing64 commented 2 years ago

I tried GlamorousToolkit ( https://gtoolkit.com/ ), It runs on Pharo90 , but it has its own VM. Chinese input can work well on it.

gtoolkit.com
Home
Glamorous Toolkit is the moldable development environment.
Dieken commented 2 years ago

Pharo 10 on macOS here, chinese input method basically works after following instructions at https://github.com/pharo-open-documentation/pharo-wiki/pull/328

  1. The word candidate panel doesn’t follow the input caret, the panel is out of Pharo window.
  2. Pharo always accepts only first character no matter the input method gives any phrase.
tomooda commented 2 years ago

@Dieken Have you tried https://github.com/tomooda/PharoIM/ on Pharo 10?

GitHub
GitHub - tomooda/PharoIM: InputMethod support for Pharo on headless VMs
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.
Ducasse commented 2 years ago

Hi tomo Would it make sense to have this code merged in Pharo?

Dieken commented 2 years ago

@Dieken Have you tried https://github.com/tomooda/PharoIM/ on Pharo 10?

Just tried Pharo 10 + PharoIM on macOS 12.3.1, it works much better, the issue 2 is gone, good job!

But the issue 1 is still there:

a. Open Pharo -> Playground, activate input method the first time, the candidate panel covers the caret, it should sit below or above the input caret as the second screenshot.

image image

b. deactivate and then activate the input method again, it seems the candidate panel loses the position of caret.

image

Looking forward to the merge of PharoIM into Pharo, well done! @tomooda

GitHub
GitHub - tomooda/PharoIM: InputMethod support for Pharo on headless VMs
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.
Dieken commented 2 years ago

Another issue on PharoIM, it doesn't support emoji, for example,with macOS Pinyin input method, when I type "hh" which means laughing "haha",the candidate panel shows "😄",then I select this candidate, PharoIM gives "h h" into Pharo playground, not the emoji character.

If I use the macOS Show emoji & symbols in mac input method menu to input emoji with Character Viewer dialog, the emoji can be inserted correctly into Pharo playground although it's garbled due to font.

image image image image
tomooda commented 2 years ago

@Dieken Thanks for the feedback. Yes, I recognize we need some adjustments to the candidates' window. I'll work on that. The issue with Emoji is interesting. Can you copy the "hh" emoji in another App (e.g. TextEdit) and evaluate "Clipboard clipboardText asArray collect: #codePoint" in the Playground? @Ducasse Yes, it'll make great benefits to CJK users, but PharoIM is sensitive to the version of SDL2 libs. @guillep and I investigated and found a problem with Linux installation at the time (https://github.com/tomooda/PharoIM/issues/11). I'll check it on the latest dev versions, probably the next Monday.

Dieken commented 2 years ago

@Dieken Thanks for the feedback. Yes, I recognize we need some adjustments to the candidates' window. I'll work on that. The issue with Emoji is interesting. Can you copy the "hh" emoji in another App (e.g. TextEdit) and evaluate "Clipboard clipboardText asArray collect: #codePoint" in the Playground?

https://emojipedia.org/beaming-face-with-smiling-eyes/

image
Emojipedia
😁 Grinning Face with Smiling Eyes Emoji
Emoji Meaning A yellow face with smiling eyes and full-toothed grin, as if saying Cheese! for the camera. Teeth may be smoothed-over or crosshatched. Often expresses a radiant, gratified…
tomooda commented 2 years ago

Thanks! That's helpful. 😄

tomooda commented 2 years ago

The emoji (and pinyin IM) now works fine with PharoIM. https://github.com/tomooda/PharoIM/issues/17#issuecomment-1150637988

tomooda commented 2 years ago

@Ducasse I'd be happy if PharoIM would be merged into Pharo. I tested PharoIM with Pharo 10/11 on mac/windows/linux. It works just as intended on Mac, works somehow ok on Windows, and works poorly on Linux but is still better than without PharoIM. I don't think PharoIM harms any non-multibyte inputs.

Ducasse commented 2 years ago

Excellent can you send a PR?

tinchodias commented 2 years ago

Hi, I wasn't aware of this issue (I should had search :P), but wanted to see why emojis didn't appear in Pharo 11. I debugged it down to FreeType bindings. In a ubuntu 22.04 (but I think in any the ttf file is discarded during the process that loads fonts from the file system (when I do FreeTypeFontProvider initialize).