Search Unity

Bug Text Mesh Pro Outline Issue UIToolkit

Discussion in 'UGUI & TextMesh Pro' started by MousePods, Mar 29, 2022.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Hi!

    This issue has been known for awhile. I finally got around to reporting it, but the developer said that it had been fixed.

    https://issuetracker.unity3d.com/is...y-doesnt-change-when-it-has-outline-or-shadow

    However, when I updated to the latest 2022.1 beta (which the bug report says its fixed in), it isn't fixed.

    I am on the latest TMP 4.0.0.

    As you can see, the 3 main issues. The bottom-right one is the correctly outlined font using Unity's outline text component. The top-left one is using UIToolkit and text mesh pro font asset.
    Screen Shot 2022-03-22 at 1.52.09 PM.png



    Is this issue not fixed in 4.0.0?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If the issue that you are reporting is the rounded nature of the outline, this is not a bug. This is simply a by product of signed distance field and dilation where the further you get from the corner / edge the rounder it will be.

    Below is an example using TMP with a similar font.

    upload_2022-3-30_12-33-29.png

    Notice above how the corners are rounded as the outline gets further from the edges.

    upload_2022-3-30_12-34-29.png

    Notice the same behavior when the outline begin to overlap.

    The way the outline component works in UI Text is by duplicating the geometry 4 times and offsetting it by the user specified amount. The first image with transparency shows these 4 copies of the geometry and the offset. The 2nd image is fully opaque.

    upload_2022-3-30_12-45-55.png

    In the image above, we can achieve a good result because of the square nature of the letter. If we do the same thing with a letter like X, we don't get the same result.

    upload_2022-3-30_12-47-24.png

    Again as I mentioned above, this is not a bug but simply how dilation works.

    There might be some alternative ways to achieve an acceptable result, I would need more information to provide additional insight such as the font and how you expect letter like X or T to look for instance.
     
  3. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Thanks for the in-depth reply!

    Here is the way it looks with T and X. The x is a bit off as its not the the same thickness around the corners of it, but it is definitely acceptable.

    Screen Shot 2022-03-30 at 5.43.21 PM.png

    I sent you the font file as a pm.

    Thanks!
     
  4. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Just wondering if anything came of this?

    Thanks!