Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-76356

Bold unicode characters appear doubled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.13-pre7
    • Minecraft 1.8.2-pre1, Minecraft 15w37a, Minecraft 15w50a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 16w15b, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12.2, Minecraft 18w03b, Minecraft 18w11a, Minecraft 18w15a, Minecraft 1.13-pre6
    • Confirmed

      When you set Force Unicode: False and try to write bold unicode characters like

      /tellraw @p {"text":"∓","bold":true}

      You will get a doubled ∓.

      The reason for that is that the method renderStringAtPos(String p_78255_1_, boolean p_78255_2_) in the /Client/src/net/minecraft/client/gui/FontRenderer.java class (MCP 1.8 names) sets a different offset for characters only if unicode is forced, however it ignores the fact that unicode characters can be displayed without unicode being forced. This offset would also affect the shadow of characters but this is disabled for unicode characters by default.

      /**
       * Render a single line string at the current (posX,posY) and update posX
       */
      private void renderStringAtPos(String p_78255_1_, boolean p_78255_2_)
      {
      	for (int var3 = 0; var3 < p_78255_1_.length(); ++var3)
      	{
      		char var4 = p_78255_1_.charAt(var3);
      		int var5;
      		int var6;
      
      		if (var4 == 167 && var3 + 1 < p_78255_1_.length())
      		{
      			//...
      		}
      		else
      		{
      			//...
      			
      			// Changed this
      			//float var12 = this.unicodeFlag ? 0.5F : 1.0F;
      			float var12 = var4 == 0 || var5 == -1 || this.unicodeFlag ? 0.5F : 1.0F;
      			boolean var7 = (var4 == 0 || var5 == -1 || this.unicodeFlag) && p_78255_2_;
      			
      			if (var7)
      			{
      				this.posX -= var12;
      				this.posY -= var12;
      			}
      
      			float var8 = this.renderCharAtPos(var5, var4, this.italicStyle);
      
      			if (var7)
      			{
      				this.posX += var12;
      				this.posY += var12;
      			}
      
      			if (this.boldStyle)
      			{
      				this.posX += var12;
      
      				if (var7)
      				{
      					this.posX -= var12;
      					this.posY -= var12;
      				}
      
      				this.renderCharAtPos(var5, var4, this.italicStyle);
      				this.posX -= var12;
      
      				if (var7)
      				{
      					this.posX += var12;
      					this.posY += var12;
      				}
      
      				++var8;
      			}
      			
      			//...
      		}
      	}
      }
      

        1. Doubled bold unicode (1.8.2-pre1).png
          33 kB
          Marcono1234
        2. screenshot-1.png
          5 kB
          [Mod] NeunEinser

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            15 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: