Simply Light

Simply Light

46M Downloads

GUI characters stick out in Japanese

Closed this issue · 1 comments

commented

Describe the bug
Sneak+right-click on Edge Light to display GUI, text is overflowing in Japanese.

Screenshots
There's on PR #54.

commented

I have confirmed that if I modify the following line, the characters will fit within the GUI when translated into Japanese, but if the translation is more than “Facing” characters in other languages, the characters may cover the switch on the left side, so it may be necessary to reduce the font if the number of characters exceeds a certain number.

Before:

int x = guiLeft + xSize - font.width(string) - 4;

image
image

After:

        int stringWidth = font.width(string);
        int directionWidth = font.width(player.getNearestViewDirection().toString());
        int maxWidth = Math.max(stringWidth, directionWidth);
        int x = guiLeft + xSize - maxWidth - 4;

image
image