Search Unity

TMP Text still blurry?

Discussion in 'UGUI & TextMesh Pro' started by andyz, Jun 22, 2022.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Came back to TMP after quite some time and in a new project when you add a UI button, you immediately notice the blurriness of the text, tried a different font too but same.
    It is quite a problem if you start from such a point, unless all text in your project will be much larger. Is there nothing to be done to maker smaller text sharper by default?
    tmp.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What font asset are you using?

    Is the above image from the Scene view or Game view? If Game view, make sure the zoom factor is at 1x.

    The text should be sharp, so we just need to identify what is causing the blurriness on your end.
     
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    default font and setup of TMP, 1x zoom but the image above is 2x to make it obvious. Just does not seem to pixel hint well
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you post an image of the font asset inspector and then an image of the text object inspector where I can see the settings on the text component along with material settings and RectTransform as well.
     
  5. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Sorry, just create a brand new 2021 LTS project, add a TMP Button and this is how it looks. Maybe not best font or font size? But it is not the best beginning as I say and Roboto font has similar issue when tested
     
  6. YuHeLong

    YuHeLong

    Joined:
    Apr 17, 2015
    Posts:
    15
    when TMP font in UI using font size less 14, in both 1K and 4K monitor full screen, the font gets blurry, just wondering if the UI text using TMP or the original one will get the text quality clear and smooth just like browser or the Unity Editor itself.
     
  7. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    well this is default button text size 24.
    But as for the Editor UI text I think that is down to carefully chosen font although the 'System Font' is much sharper than the bizarre default choice (Inter) which is less so, particularly some letters like 't' & 'T'
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Here are the results that I am getting on my end comparing UI.Text and TMP (Buttons) with default 24 point size. The font used is Liberation Sans.

    The top button is UI.Text and the Bottom TMP using the default Liberation Sans SDF.

    upload_2022-6-24_15-35-28.png
    24 point size (1:1)

    upload_2022-6-24_15-37-50.png
    Same as above 1000%

    upload_2022-6-24_15-38-12.png
    Same but with TMP material sharpness slider at 0.25 (1:1)

    upload_2022-6-24_15-38-56.png
    Same but at 1000%

    Note the default color is not pure black but R=50, G=50 and B=50 which does contribute to making the text appear softer.

    upload_2022-6-24_15-43-4.png
    Black color at 1:1 but no Sharpness.
     
  9. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Yes IMHO it's not really sharp enough to use at that size and below, though I accept it is close to the old font renderer. SDF is fine on a 4k screen or for large text but a bit too blurry at smaller sizes.
    Windows native-apps have ClearType - sub-pixel AA for best text at 1080p, but since we can not use in Unity a hand-crafted 'pixel-snapped' font would be better - see Unity Editor's 'System Font' (I assume this is a bitmap font?).
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Not all fonts render equally well at small point size.

    For instance, Verdana and Lucida Grande (previously used in the Editor) were both designed for small point size and would render better at smaller point size than a font like Roboto or Liberation Sans for instance as these were not specifically designed for small point size.