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

Sub-pixel advances in space provider can stretch following characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.1, 1.20.4, 24w09a
    • None
    • Community Consensus
    • (Unassigned)

      The space font provider allows the definition of floats for advances. This is generally very useful, because many players play on gui-scales larger than 1 and this allows for more precise control over spaces between characters. However, when an advance translates to a space that is smaller than 1px, the following character is stretched in a weird way.

       

      Observed behavior:

      In the following example, I've configured the character 'a' to be a space of 0.5 units:

      {
          "providers": [
              {
                  "type": "space",
                  "advances": {
                      "a": 0.5
                  }
              }
          ]
      } 

      When playing on gui-scale 1 and writing `AaA` in the chat, it looks like this:


       
      This always happens when `advance * guiScale` is not an integer.

      Expected behavior:

      I'd expect that `advance * guiScale` would either rounded or truncated to an integer, or that they stack and a space is rendered once they've reached 1px

        1. buggy font.png
          buggy font.png
          0.4 kB
        2. example.zip
          0.9 kB
        3. Photo_Bqyqx0e515.png
          Photo_Bqyqx0e515.png
          23 kB

            Unassigned Unassigned
            StudioCode StudioCode
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: