Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug [TextMesh Pro] Mesh Bounds Appears to be Incorrect

Discussion in 'UGUI & TextMesh Pro' started by NiallSoe, Mar 24, 2023.

  1. NiallSoe


    Jan 30, 2018
    hi @Stephan_B ,

    I have noticed that the mesh bounds can be misreported in some circumstances.

    I have been trying to use the Text's reported mesh bounds to assist with layout which led me to double check my results with the in-built info component. Turning on the "Show Mesh Bounds" option in the "TMP_Text Info Debug Tool" component confirms the results I am seeing.

    I would expect the orange box to only continue as far as the right hand side of the final t's quad.


    If I reduce the Text's RectTransform width, then the mesh bounds begin to display correctly at a certain point:


    The same problem occurs with the vertical bounds if top or bottom alignment is selected and the Text's RectTransform height is quite large:


    Setup: Unity 2021.3.17 and TMPro 3.0.6.

    Thanks a lot.

    Attached Files:

  2. NiallSoe


    Jan 30, 2018
    I've also hit an issue where I've managed to break the geometry based centring using Rich Text Tags...



    It seems to partially linked to the negative character spacing as when I change the final one to 0, it renders more in the centre of the rect (but still not quite centred).



    Other types of alignment are also broken with the original string, most noticeably Right alignment: