iced
iced copied to clipboard
basic IME support rebase
General
This PR fix #979,#1544. iced ime support was broken due to winit 0.27 update . This PR add event to fit new winit IME event model and introduce new event support for text_input.
how to test
download app from my repo https://github.com/KentaTheBugMaker/iced_text_input_sample/
Phase 1 : Can we input CJK characters?
tested on
- [x] windows MS-IME
Phase 2 : Candidate position is near the TextInput?
You maybe failed to reproduce due to IME version. candidate positon on X11 require LibX11 1.8.2 or above.
Wayland requirement.
- input_method_v2 popups
tested on
- [x] windows MS-IME
Phase 3 draw underline and cursor
behavior
https://user-images.githubusercontent.com/48007646/205664366-ea71ddaf-a778-4f1a-9d0e-1b5cb557e70c.mp4
test
not required. We render underline and cursor correctly if winit correctly report it.
- [x] windows
Note
I don't have a macos device, so if you notice any problems, macos users please fix them.
Some tests were done by other users. but Iced rework enforce me to reimplement completely. Therefore old tests are not compatible with this version.
feel free to reimplement this.
I tracked this pr daily, hope to see it will be merged into main brach some day.
Work related to IME is slated around the 0.12
release. See the ROADMAP.
I will take a look at this by then!
Thank you for working on this. This is a mandatory feature for CJK users.
I tried this branch on macOS and I found one small issue. When some character was already input before a cursor, the insert position of IME candidates was a bit wrong.
https://github.com/iced-rs/iced/assets/823277/ed7222b2-943e-4c85-8ca2-ecaa71762fe8
- Enable Japanese IME
- Type aiueo and Return
- Text あいうえお is inserted
- Type kakikukeko
- Expected the candidate かきくけこ was positioned at after お, but it was actually positioned before お
After selecting the candidate, the text かきくけこ is inserted at correct position. So only the position of IME candidate is wrong.
run iced-ime_adavanced_text\examples\todos
We can't measure width of IME candidate window. So some overflow may occur but it seems to too large overflow. We offset candidate window when text content overflow the TextInput widget.
It's normal, thank you for your efforts
The default windows input method can be used normally, but the "Sogou input method" still has problems, and the console will prompt: "libpng warning: iCCP: known incorrect sRGB profile"
iced now using winit 0.28.6 fork. therefore you need to test winit ime example. if same problem ocurred we can't fix this problem.
Awesome work!
Hi, I understand that IME is scheduled for a later release in the roadmap, but it is a crucial feature for me and many others. Please consider moving IME to an earlier release. What is still needed before this feature can be merged? Thank you for the incredible work!
@hecrj IME support is a fundamental feature for non-European users. What's blocking this PR ? or We need to make some RFC for IME?