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

Potentially Faulty Font-magic implementation when paired with retextured default fonts #1043

Open
SpecialBuilder32 opened this issue Sep 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SpecialBuilder32
Copy link
Member

This issue tracks a potential issue discussed at a recent Dev Night related to our resource pack's usage of fonts to add custom textures to guis. The discussion concluded that it wasn't vital to fix at the moment, but if this issue crops up in the future, having this record of the causes and reasonings for those causes is useful.

The primary tool behind font magic is the ability to write a string normally to display it, and then write it again invisibly backwards to reset the cursor to the original location. Before 1.20.2, these backwards characters were implemented by using the default minecraft font, but displayed at a large offset so they render offscreen. In 1.20.2, this behavior was broken and replaced with a "negative space" provider, which we used to list out the negated width of every character in the vanilla font.

By no longer referencing the vanilla textures at all in the backwards characters definition, a user using a retextured font (particularly one with different character widths) no longer has the forward displayed string line up with our reverse string and its hardcoded negative space widths.

It seems there is not the ability in current font technology to dynamically read in the actual minecraft:default font and invert every character as was done before 1.20.2, so this issue may appear to such a user as a horribly misaligned set of GUI textures inside our custom machine blocks.

@SpecialBuilder32 SpecialBuilder32 added the bug Something isn't working label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant