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

Extend Minecraft to display more Unicode characters. #5

Open
wohaopa opened this issue Mar 4, 2024 · 6 comments
Open

Extend Minecraft to display more Unicode characters. #5

wohaopa opened this issue Mar 4, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@wohaopa
Copy link

wohaopa commented Mar 4, 2024

It is well known that Java's char and String use UTF-16 encoding. Minecraft's character rendering system is designed to only support the first 16384 code points of UTF-16. For characters in the supplementary planes of UTF-16, Java uses two char to store one character, but Minecraft's character rendering does not support them. To better support internationalization, it might be advisable to extend it. Now, I have created a mod that enables Minecraft's character rendering to support more UTF-16 characters (currently, UTF-16 uses at most two char, specifically: the Basic Multilingual Plane uses one char, and the Supplementary Planes use two char). This mod allows directly using the unicode points of characters for layout.

@wohaopa
Copy link
Author

wohaopa commented Mar 4, 2024

For example: The character: 𬭶 (Hassium) has a Unicode encoding of U+183158, represented in hexadecimal as 0x2CB76. This character cannot be displayed in Minecraft because Minecraft can only display characters from 0000 to FFFF. However, this mod allows displaying these additional characters. Specifically, you only need to place these additional characters according to the original method of storing Unicode characters in Minecraft (the first two hexadecimal digits represent the file name, the third digit represents the row number , and the fourth digit represents the column number). The last two hexadecimal digits represent the row and column numbers, and the remaining characters represent the file name. For example: 2CB76 is located at the 7th row and 6th column of the 2cb file.

@miozune miozune added the enhancement New feature or request label Mar 5, 2024
@miozune
Copy link
Member

miozune commented Mar 5, 2024

Is it possible to convert the mod to Mixin or at least make it easier to read? Some of the optimization/tweak mods touch FontRenderer and there could be a chance of conflict. Mixin would make maintenance easier, especially if you went inactive in the future.

@wohaopa
Copy link
Author

wohaopa commented Mar 5, 2024

Is it possible to convert the mod to Mixin or at least make it easier to read? Some of the optimization/tweak mods touch FontRenderer and there could be a chance of conflict. Mixin would make maintenance easier, especially if you went inactive in the future.

Yes, these ASMs were written exactly to be compatible with other mod modifications FontRenderer. Some mixins may not be clear to me. I will find a way to make this confusing code clearer.

@mitchej123
Copy link

  1. Taking a look at the ASM, I'm not sure it'll be compatible with the batch font renderer from Angelica
  2. Mixins would be a lot more readable & maintainable for this type of mod, imho
  3. The mod would need to have a FOSS license for potential inclusion into the pack

@wohaopa
Copy link
Author

wohaopa commented Mar 6, 2024

3. The mod would need to have a FOSS license for potential inclusion into the pack

Well, it doesn't seem to work with Angelica, I'm trying to fix it.
transform was chosen for performance and complexity reasons. Mixins are a good choice, I will rewrite them in mixins after I understand

@wohaopa
Copy link
Author

wohaopa commented Mar 6, 2024

@mitchej123 I find the problem, the BatchedFontRendererRenderString method to intercept the upstream. Maybe I can only change this part from it angelica. I don't think this mod is suitable for angelica integration because it's too big

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

No branches or pull requests

3 participants