Search Unity

CharacterInfo.advance is an integer... why?

Discussion in 'Editor & General Support' started by KaiClavier, Jul 5, 2019.

  1. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    https://docs.unity3d.com/ScriptReference/CharacterInfo-advance.html

    "The horizontal distance, rounded to the nearest integer, from the origin of this character to the origin of the next character." Why is it rounded to the nearest integer? Is there a way to get CharacterInfo.advance without rounding?



    (Unity's text renderer on top, mine on the bottom, note the kerning between the "T" and "o")

    I've narrowed down the issue, and I'm 99% sure this value being rounded to an integer is the culprit.

    I've also tried grabbing the font data at a larger size and scaling the advance down, and while it's *more* accurate, it's still not accurate.
     
  2. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    Should I crosspost? This isn't exclusively a UI issue, I just used my asset running in UI mode to demonstrate, but the same image could be recreated with a standard text mesh.