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

Invalid font characters remember their width and the placeholder glyph incorrectly uses it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.2 Release Candidate 1
    • None
    • Community Consensus
    • Resource Packs, Text

      Discovered while testing MC-277670.

      The bug

      If an invalid texture is used for a text character, the missing glyph will replace it. However, the character will still behave as though it has the expected size from the provided texture file.

      How to reproduce

      A resource pack is attached to this ticket that replaces "A" with a 257-wide, 1-high texture, and "a" with a 1-wide, 257-high texture. Both of these exceed the maximum dimensions for a font character.

      1. Download and apply the attached resource pack
      2. Observe the letters "A" and "a" in context
      3. Optionally compare to a character with no defined glyph: 

      Expected results

      These would appear as normal missing glyphs.

      Actual results

      "A" causes a huge gap after itself, and "a" bleeds into the next character.

      How to fix

      When making these use the missing glyph, it should also set the dimensions to the correct value.

        1. 2024-10-18_15.23.07.png
          283 kB
          Connor Steppie
        2. 2024-10-18_15.26.27.png
          433 kB
          Connor Steppie
        3. 2024-10-18_15.29.37.png
          473 kB
          Connor Steppie
        4. 2024-10-18_15.36.27.png
          287 kB
          Connor Steppie

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: