mojira.dev
MC-108323

Underlines in chat and /title command intersect each other, causing an ugly effect when fading

The bug

Underlines in chat and /title command intersect each other, causing an ugly effect when fading.

How to reproduce

Take a screenshot or enter the following command:

/title @a title {"text":"words","underlined":true}

→ ❌ Note how the pixels in the underline between the individual characters of the word "words" are much bolder than they should be when the text is fading in and out.

Note: You can make the effect more obvious by first using the command

/title @a times 100 0 100

Code analysis

Based on 1.11 decompiled using MCP 9.35 rc1

The method net.minecraft.client.gui.FontRenderer.renderStringAtPos(String, boolean) has a strange condition when drawing underlined text. It enlarges the line one pixel to the left if it should draw underlined text, which is of course always true because it is currently drawing underlined text. Maybe it was supposed to test if the text is italic or unicode? But enlarging the line to the left means that it will overlap if a underlined character is in front of it, which causes this effect.

Removing this should probably not cause any problems.

Examples

Here are some examples:

[media][media]

Linked issues

Attachments

Comments 17

CDES5

Quote:
Based on 1.11 decompiled using MCP 9.35 rc1

Must affect 1.11

ZeNico13

Still in 19w11a and 19w11b

ZeNico13

Still in 19w12b

ZeNico13

Still in 19w13a

ZeNico13

Still in 19w14a

7 more comments
Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.18.2 and 22w16b.

Avoma

Can confirm in 1.19 and 22w24a.

Avoma

Can confirm in 1.19.2.

null

It enlarges the line one pixel to the left if it should draw underlined text

I'm pretty sure this is intentional. Currently, the underline extends 1 pixel left and 1 pixel right of the character, which causes overlap. If they remove the 1 extra pixel on the left, then the underline won't be symmetrical anymore.

Avantir_Yihn

Fantastime

Confirmed

Platform

Low

Rendering

/title, command, fade, fadeout, smooth, underline, underlined-text

Minecraft 1.10.2, Minecraft 16w39c, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, ..., 1.20.1, 1.20.2, 1.20.3 Pre-Release 2, 1.20.4, 24w13a

24w40a

Retrieved