iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.71k stars 1.16k forks source link

Unable to input Chinese chars in TextInput and TextEdit #2645

Open blackwhite-bear opened 2 weeks ago

blackwhite-bear commented 2 weeks ago

Is your issue REALLY a bug?

Is there an existing issue for this?

Is this issue related to iced?

What happened?

Unable to input Chinese fonts in TextInput and TextEdit

The example of my project just likes below

fn main() {
    let _ = application("", APP::update, APP::view)
        .font(include_bytes!("../img/MiSans.ttf").as_slice())
        .default_font(Font::with_name("MiSans"))
        .run();
}

.push(TextInput::new(conval::CALL, self.installer_info.name.as_str()).on_input(Message::ChangedName),)

Match _ {
    Message::ChangedName(name) => self.installer_info.name = name,
}

It's OK to show Chinese fonts in the interface. Even though, Text Fields can show Chinese when using CTRL+V to paste some into, it can not be done by using the keyboard and can only receive ASCII chars.

System information Deepin V23 6.6.47-amd-desktop-hwe X11

What is the expected behavior?

able to receive Chinese chars into Text Fields

Version

crates.io release

Operating System

Linux

Do you have any log output?

No
jellybobbin commented 2 weeks ago

Have the same problem。

cargo 1.81.0 (2dbb1af80 2024-08-20) iced = "0.13.1" Darwin Mac-mini 22.6.0 Darwin Kernel Version 22.6.0: Mon Feb 19 19:48:53 PST 2024; root:xnu-8796.141.3.704.6~1/RELEASE_X86_64 x86_64

KentaTheBugMaker commented 2 weeks ago

Iced doesn't support winit IME related things. I tried to support it by adding IME Event to Iced Event and interface for ime.

Result Hecrij doesn't think about non-european input. no reply from him. We can support IME. but too many fixes needed to widgets. and i can't spend many times for very early dev stage of unusable toolkit.

let's see #1858 or Maybe we need to create work group for it.

blackwhite-bear commented 2 weeks ago

It looks like there are many things to be done, and the progress is fascinating.

Thanks for your update

I can not work on this kind of issue. Considering this function is deeply related with platforms and may have been changed continually, building an exclusive group for it is a good idea, anyway, if this function needs to be adjusted frequently.