The following code was used to test:fontRenderer.drawStringWithShadow(str, x - fontRenderer.getStringWidth(str) , y, color);
where string is the text on the left side of the screen, x is the width of the screen - 2, y is 2 and color is 0xFFFFFF.
The gui scale is set to normal; any pixel units bellow should be divided by 2 for the actual (code) values.
The first line is normal text, used as a reference.
The second line is a bold modifier, followed by 15 color modifiers. The expected result should be something similar to the third line, but the color modifier seems to override the bold modifier.
The third line contains 15 color modifiers followed by a bold modifier. The bold modifier is applied as expected, but one can see a 2 pixel difference compared to the first line.
The fourth line is simply 15 color modifiers is what is expected.
The fifth and final line is 15 bold modifiers. One can clearly see the difference with the first line (30 pixels).
Subtracting the amount of bold modifiers solves the issue with lines 3 and 5.
Possibly related to MC-23952.
Attachments
Comments 4
I honestly don't see how that is an issue. Fact is that getStringWidth
returns an incorrect string length, which will cause any right/center aligned bold text to not display properly.This applies to both, vanilla and modified by whatever 3rd party tool.
This ticket is invalid as it relates to a modified or 3rd party client, server, or launcher.
Any non-standard client/server/launcher build needs to be taken up with the appropriate team, not Mojang.
Any plugin issues need to be addressed to the plugin / resource pack creator.
This site is for addressing issues related to the base unmodded Minecraft; Bukkit, Forge, Optifine, or any other modded system may invalidate your ticket.
Additionally, if you have problems on servers like Hypixel or The Hive, please report it to their corresponding site. It's probably not a bug in Vanilla Minecraft.