pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Chinese characters cannot input in Pharo

Open liangbing64 opened this issue 3 years ago • 19 comments

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:

  • OS: [Win10]
  • Image: 1168]
  • VM: 90X64 last March 1

liangbing64 avatar Mar 01 '21 06:03 liangbing64

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 is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk. - pharo-project/pharo

welcome[bot] avatar Mar 01 '21 06:03 welcome[bot]

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 is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

guillep avatar Mar 15 '21 14:03 guillep

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.

liangbing64 avatar Aug 25 '21 03:08 liangbing64

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

shixiongfei avatar Apr 14 '22 15:04 shixiongfei

@guillep

Ducasse avatar Apr 18 '22 16:04 Ducasse

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
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.

guillep avatar Apr 19 '22 08:04 guillep

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
Glamorous Toolkit is the moldable development environment.

liangbing64 avatar Jun 03 '22 03:06 liangbing64

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.

Dieken avatar Jun 07 '22 01:06 Dieken

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

GitHub
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.

tomooda avatar Jun 07 '22 07:06 tomooda

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

Ducasse avatar Jun 07 '22 14:06 Ducasse

@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
InputMethod support for Pharo on headless VMs. Contribute to tomooda/PharoIM development by creating an account on GitHub.

Dieken avatar Jun 07 '22 14:06 Dieken

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

Dieken avatar Jun 07 '22 15:06 Dieken

@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.

tomooda avatar Jun 07 '22 21:06 tomooda

@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…

Dieken avatar Jun 08 '22 01:06 Dieken

Thanks! That's helpful. 😄

tomooda avatar Jun 08 '22 01:06 tomooda

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

tomooda avatar Jun 09 '22 03:06 tomooda

@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.

tomooda avatar Jun 15 '22 08:06 tomooda

Excellent can you send a PR?

Ducasse avatar Jun 15 '22 12:06 Ducasse

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).

tinchodias avatar Aug 05 '22 14:08 tinchodias