PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
54 stars 21 forks source link

Fix "Force Unicode: Off" limitation for font images #1276

Closed LoneDev6 closed 3 years ago

LoneDev6 commented 3 years ago

Describe the solution you'd like

Use another font (1.16.5+) to display emojis to avoid having to use "Force Unicode: Off".

Introduce a new attribute for font_images font_name which will create a new font and will register the font_image in this font (basically will act as a group). The default value of this attribute would be (for example) custom.

Warning: test what happens if this feature is used on clients and on servers which are < 1.16.5.

Is your feature request related to a problem?

Having to use "Force Unicode: Off" to see emojis and other font_images.

LoneDev6 commented 3 years ago

The whole thing is doable but would make the processing of HUDs and other stuff very heavy and potentially create a lot of garbage for the GC, create unnecessary CPU overhead and confuse a lot of admins.

I decided to make a global use_separate_custom_font_file: true attribute in the config.yml of ItemsAdder which will avoid saving into default.json and will save images into a new custom.json file.

Please note that this has some downsides:

LoneDev6 commented 3 years ago

immagine

LoneDev6 commented 3 years ago

https://itemsadder.devs.beer/plugin-usage/adding-content/advanced/font-images/alternative-font-file

I found another big compatibility issue. Minecraft doesn't support json components in language files, so we cannot retexture ESC menu and similar places if using a custom font. https://bugs.mojang.com/browse/MC-195666 I'm afraid I might have to rollback all the changes for this commit...

Andre601 commented 3 years ago

https://itemsadder.devs.beer/plugin-usage/adding-content/advanced/font-images/alternative-font-file

I found another big compatibility issue. Minecraft doesn't support json components in language files, so we cannot retexture ESC menu and similar places if using a custom font. https://bugs.mojang.com/browse/MC-195666 I'm afraid I might have to rollback all the changes for this commit...

Or you could offer two separate solutions. The old (current) system for things like GUI stuff and the font thing for chat and other places that support JSON and custom font. My initial idea was for those specific places, so that the unicode stuff could be utilized for other stuff (Have more available icon spaces for GUI and alike) while the custom font would be mainly utilized for stuff that mainly works on chat or JSON-based stuff anyway.

LoneDev6 commented 3 years ago

The amount of characters is not really a problem (at least for me) since ItemsAdder allows ~6608 characters to be added to the game, and I can even increase this amount.

My initial idea was for those specific places, so that the unicode stuff could be utilized for other stuff

Depends what you need to do, currently it's easier to manage the characters which have a custom font by directly creating the files manually: https://itemsadder.devs.beer/plugin-usage/adding-content/advanced/font-images/alternative-font-file

Caishangqi commented 2 years ago

Hi :) could I still use this experimental feature? I could not find the configuration part of this option.

LoneDev6 commented 2 years ago

This was removed because of how resource intensive it was and had too many downsides. Read more here: https://itemsadder.devs.beer/old/deprecated/alternative-font-file#downsides-and-upsides

Caishangqi commented 2 years ago

Got it, thanks for reply :)