Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextEdit or LineEdit cannot input Chinese characters on the web #91204

Closed
zaichenhu opened this issue Apr 26, 2024 · 12 comments · Fixed by #91695
Closed

TextEdit or LineEdit cannot input Chinese characters on the web #91204

zaichenhu opened this issue Apr 26, 2024 · 12 comments · Fixed by #91695

Comments

@zaichenhu
Copy link

zaichenhu commented Apr 26, 2024

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 zaichenhu changed the title TextEdit or LineEdit cannot input chinese on the web TextEdit or LineEdit cannot input Chinese characters on the web Apr 26, 2024
@akien-mga
Copy link
Member

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

@zaichenhu
Copy link
Author

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.

@akien-mga
Copy link
Member

CC @bruvzg

@bruvzg
Copy link
Member

bruvzg commented Apr 29, 2024

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 bruvzg self-assigned this Apr 29, 2024
@zaichenhu
Copy link
Author

zaichenhu commented Apr 30, 2024

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

@Zireael07
Copy link
Contributor

It is highly likely that this is indeed a font issue

@zaichenhu
Copy link
Author

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
Copy link
Author

zaichenhu commented May 3, 2024

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?

@bruvzg
Copy link
Member

bruvzg commented May 3, 2024

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.

@zaichenhu
Copy link
Author

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.

@bruvzg
Copy link
Member

bruvzg commented May 7, 2024

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

@Kiisu-Master
Copy link
Contributor

Kiisu-Master commented May 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants