godot icon indicating copy to clipboard operation
godot copied to clipboard

TextEdit or LineEdit cannot input Chinese characters on the web

Open zaichenhu opened this issue 10 months ago • 6 comments

Tested versions

Maybe all versions have the same issue, I am using v4.2.2 stable.

System information

Windows10 -Godot v4.2.2.stable.official

Issue description

In Godot 4.2.2, LineEdit or TextEdit cannot input Chinese characters on the Web, but it works on PC. This issue may also affect other non-English characters. It is likely caused by the IME, as Unity also encounters similar problems. There isn't a good solution yet. Since Godot is an open-source community, we hope this bug can be fixed as soon as possible.

Steps to reproduce

Please using textedit or lineedit node in a scene, export to a web build, and download a Microsoft Pinyin input method or something similar to test it.

Minimal reproduction project (MRP)

The project is very simple, you can create by yourself, thank you!

zaichenhu avatar Apr 26 '24 08:04 zaichenhu

This should be fixed in 4.3 already by #79362. Can you test 4.3-dev5 and confirm?

akien-mga avatar Apr 26 '24 08:04 akien-mga

This should be fixed in 4.3 already by #79362. Can you test 4.3-dev5 and confirm?

TestIME I tried testing the web version with Microsoft Pinyin input method in the 4.3 dev5 version. There are two issues: first, Chinese characters are not displayed correctly (I am using a font that supports Chinese characters); second, the IME suggestion continuously moves downward as I type.

zaichenhu avatar Apr 27 '24 04:04 zaichenhu

CC @bruvzg

akien-mga avatar Apr 29 '24 07:04 akien-mga

first, Chinese characters are not displayed correctly

Web can't use system font, probably custom font is not set properly (it might be displayed correctly in the editor, since editor will use system fonts as fallback).

second, the IME suggestion continuously moves downward as I type.

Which browser are you using?

bruvzg avatar Apr 29 '24 07:04 bruvzg

first, Chinese characters are not displayed correctly

Web can't use system font, probably custom font is not set properly (it might be displayed correctly in the editor, since editor will use system fonts as fallback).

second, the IME suggestion continuously moves downward as I type.

Which browser are you using?

I encounter the same issue when using the default font of Godot, but it works fine with NotoSansSC (Google font). The first issue might be font-related. I tested it on Chrome and Edge, and the suggestions gradually move down as I type.

TestIME2

zaichenhu avatar Apr 30 '24 08:04 zaichenhu

It is highly likely that this is indeed a font issue

Zireael07 avatar Apr 30 '24 15:04 Zireael07

It is highly likely that this is indeed a font issue Is it possible to fix this issue in the 4.3 stable version?

zaichenhu avatar May 03 '24 13:05 zaichenhu

It is highly likely that this is indeed a font issue About the second issue, I have tested it in the Firefox browser and it works well(the suggestions don't move down as I type), maybe it's a issuse related to the browser?

zaichenhu avatar May 03 '24 15:05 zaichenhu

It might be a browser issue, AFAIK only Firefox has full IME implementation.

Font issue (if you mean loading system fonts) can't be fixed since none of the browsers implement the required API.

Loading custom fonts should already work fine. Note that a lot of fonts have CJK characters in a separate file (especially big pan-Unicode fonts like Noto), you should include all relevant files and setup font fallbacks in the import setting for it to work.

bruvzg avatar May 03 '24 15:05 bruvzg

It might be a browser issue, AFAIK only Firefox has full IME implementation.

Font issue (if you mean loading system fonts) can't be fixed since none of the browsers implement the required API.

Loading custom fonts should already work fine. Note that a lot of fonts have CJK characters in a separate file (especially big pan-Unicode fonts like Noto), you should include all relevant files and setup font fallbacks in the import setting for it to work.

Since I am not very familiar with IME, I would like to ask when approximately can this move-downward issue be fixed for other web browsers? Typing input is a very important feature for my project.

zaichenhu avatar May 07 '24 07:05 zaichenhu

I would like to ask when approximately can this move-downward issue be fixed for other web browsers?

Most likely it's a Windows specific Chromium bug (I can't reproduce it in any browser on macOS), and there is no API to control suggestion window position directly, so we can't really fix it (I'll try testing some possible workarounds later this week, but there's no guarantee it will do anything).

bruvzg avatar May 07 '24 07:05 bruvzg

Font issue maybe related to #80237 ? It has caused similar problems in one project i help.

Kiisu-Master avatar May 08 '24 08:05 Kiisu-Master