Search Unity

Question Characters Alignment Artifacts

Discussion in 'UGUI & TextMesh Pro' started by superexplosive, Jun 25, 2020.

  1. superexplosive

    superexplosive

    Joined:
    Mar 4, 2015
    Posts:
    12
    Hi,

    We are using TMP Pro with custom fonts. In case of big-screen resolutions (for example iPad's 2732x2048) letters look great. In the case of smaller resolutions (1024x768), some letters start to "jump".

    Text at 1024x768 resolution, please, note alignment of letters "a", "л", "к":
    image_2020-06-25_14-46-01.png

    Same text at 2732x2048 resolution:
    image_2020-06-25_14-45-49.png

    We have tried different values for atlas resolution and padding but it did not help. Now fonts have 2048x2048 resolution and 8px padding.

    Will be happy if someone can help out!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What is the sampling point size and padding value used?

    What Raster Mode are you using? In case you are not using SDFAA, see if you get the same issue using that mode.
     
  3. superexplosive

    superexplosive

    Joined:
    Mar 4, 2015
    Posts:
    12
    Hi Stephan,

    Here are values that we are using:
    - Point size: auto = 88
    - Padding: 8
    - Raster mode: SDFAA_HINTED

    Previously we used simple SDFAA but it was even worse.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What is the point size used on the text objects?

    At small point size and depending on the font, character spacing (as part of the design of the font), kerning, etc. you end up with some characters or part thereof not pixel aligned. This can cause some characters to look blurrier than others.

    Horizontal position of the text object can also affect this, assuming you are using a small point size.
     
  5. superexplosive

    superexplosive

    Joined:
    Mar 4, 2015
    Posts:
    12
    We use two sizes for fonts: 14pt and 17pt.
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide me with the source font file(s) that you are using for me to take a closer look?

    Are you able to easily reproduce this in the Editor using two different text objects with those two font assets and point sizes? Ie. What are the steps for me to reproduce this.