Search Unity

Question [TMP_Pro] Gray boxes around my symbols in scene view

Discussion in 'UGUI & TextMesh Pro' started by ViacheslavRud, Nov 1, 2022.

  1. ViacheslavRud

    ViacheslavRud

    Joined:
    Aug 1, 2018
    Posts:
    24
    Hello!
    I'm facing the issue that Text Mesh Pro adds gray boxes around every symbol. But they become less visible when I zoom in.
    But I don't see them in Game view and on a device.
    upload_2022-11-1_23-10-26.png
    upload_2022-11-1_23-10-29.png

    With the default font, it's less visible but becomes more noticeable when I zoom out.
    upload_2022-11-1_23-15-8.png
    upload_2022-11-1_23-15-42.png

    What causes it, and how can I fix it?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    The most common cause of this is often a zero (0.0) value for scale being set somewhere in some transform related to those RectTransforms.

    The proper way to set scales:

    https://forum.unity.com/threads/onpointerenter-loose-image.1152686/#post-7396073

    NEVER set scale (or any part of scale) to zero or negative.

    NEVER use Vector2 because that makes the third term (Z) zero.

    ALWAYS use Vector3, and make sure that the .z is either 1.0f, or else your non-zero scale.

    Similarly never set scale to Vector3.zero, especially in a UI, because this will cause layout divide-by-zeros and damage all your hierarchy.
     
  3. ViacheslavRud

    ViacheslavRud

    Joined:
    Aug 1, 2018
    Posts:
    24
    Thanks for the idea. I think I may be related to scale since in changes with zoom. But I think it's a bit different case.

    My canvas has a Canvas scaler with ConstantPhysical size. DPI is 200. So the scale is grayed out and around 6.
    I tested the text right on the canvas. Scale of the text object is 1. And I actually never change a scale on canvas.

    I've just found something in the font material. Dilate, outline, seem to influence it. but does not remove the issue.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Just short circuit all this noise, hide the one you have above, make a fresh one.

    If that still has the problem, make a new canvas, make a new fresh button, figure it out.
     
  5. ViacheslavRud

    ViacheslavRud

    Joined:
    Aug 1, 2018
    Posts:
    24
    I have the same issue in a brand new 2d project. It's more visible with the Simulator option in the Game view. Actually on non-simulator is ok, you need to zoom out a lot to see it.

    I also found out that smaller padding can cause this issue on Game(simulator also) view. But it does not influence on scene view.


    I found that I could post it in a better forum: Forums > Unity Community Discussion > UI Systems > UGUI & TextMesh Pro If there are admins please move this topic there.
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See FAQ Question 2 in the following post and sticky thread in this forum.

    This behavior occurs when the Sampling Point Size to Padding ratio is too small.
     
    ViacheslavRud likes this.