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

[enhancement] CJK display and IME support #11

Open
frg2089 opened this issue Jan 29, 2021 · 5 comments
Open

[enhancement] CJK display and IME support #11

frg2089 opened this issue Jan 29, 2021 · 5 comments

Comments

@frg2089
Copy link
Contributor

frg2089 commented Jan 29, 2021

We can used MonoGame.IMEHelper to support IME easily.

However, as @Rampastring said, support for CJK character input requires that Chinese fonts be encapsulated in a spritefont file.

MonoGame's tool for making spritefont exchanges build time for space making the resulting spritefont.xnb file very small.

This is not a problem in general, there aren't that many letters in total are there?

But with CJK, it's a big problem, we have thousands of characters!
The time required for one build is very, very huge (maybe a month?) !

1. So, we need to modify the source code of dotnet-mgcb so that instead of trading time for space, we trade space for time.

https://github.com/MonoGame/MonoGame/blob/931bbd110cfce68e351dd1ca53de9938b06dbf4f/MonoGame.Framework.Content.Pipeline/Graphics/Font/IFontImporter.cs#L5

Note

I'm not sure if the xnb files generated by dotnet-mgcb can be used by the XNA framework.
I maintain the client for the game module Extreme Starry, but I removed XNA support from it.

2. Or used FontStashSharp.MonoGame to supported ttf file.

Note

It will be a huge undertaking.

Link

Translated with DeepL.com (free version)

@frg2089

This comment was marked as spam.

@frg2089 frg2089 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
@frg2089 frg2089 changed the title [enhancement]IME Support [enhancement] CJK display and IME support Mar 9, 2024
@frg2089 frg2089 reopened this Mar 9, 2024
@frg2089
Copy link
Contributor Author

frg2089 commented Mar 11, 2024

I've noticed that it's very difficult to achieve IME support for better results without modifying MonoGame.
On platforms that use WinForms (WindowsDX or XNA), I can Hook WndProc via NativeWindow.
But when using SDL2 the situation is different, there is no Hook solution for the SdlRunLoop method, making it impossible to provide good IME support on SDL2 platforms.

We have to wait for MonoGame to make changes before we can move forward.

As well, this means that versions built for the .Net Framework will never be able to fully support IME, as MonoGame has dropped support for that version. Unless we create our own fork.

References

@frg2089
Copy link
Contributor Author

frg2089 commented Mar 11, 2024

@SadPencil Do you think we should create our own fork to provide IME support?
Mainly to provide support for .Net Framework 4.8

I think we shouldn't have enough manpower and energy to do that.

@SadPencil
Copy link
Contributor

@SadPencil Do you think we should create our own fork to provide IME support?

Mainly to provide support for .Net Framework 4.8

I think we shouldn't have enough manpower and energy to do that.

I am not familiar with MonoGame. Personally I think DX and XNA should be sufficient for most Chinese players?

@frg2089
Copy link
Contributor Author

frg2089 commented Mar 11, 2024

I am not familiar with MonoGame. Personally I think DX and XNA should be sufficient for most Chinese players?

I have a simple demo, you can see how it works and I can send a PR if you think it's good.

DX and XNA only. And I don't have the XNA runtime to test it.
demo.zip

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

No branches or pull requests

2 participants