Search Unity

Bug (TMP) Linked Overflow and rich text don't play nice.

Discussion in 'UGUI & TextMesh Pro' started by samboknight, Jan 31, 2023.

  1. samboknight

    samboknight

    Joined:
    Aug 31, 2019
    Posts:
    25
    There are several tags that Linked Overflow doesn't seem to play well with. There are probably more, but these are the strange interactions I've seen with it. The example scene from the images is attached. It requires the Examples & Extras package to work. Unity version is 2021.3.14.

    As a workaround for now, I'm not using Linked Overflow and instead just breaking up the text manually.

    <line-indent>

    The line indent should only apply to the first line, but when the text overflows, it "resets" and applies to the first line of the next text mesh. This cannot be fixed by setting the line-indent back to 0 before the break in the text.

    Screenshot from 2023-01-31 14-49-01.png

    <u>

    If the text break is in the middle of text that has an underline applied, the underline will extend a great distance to the left of the first character in the next text mesh. Each edit made to the text afterward seems to make the underline extend even further.
    Screenshot from 2023-01-31 14-49-28.png


    <link>

    If there is a link tag before the text break, everything seems normal until you switch to play mode. When play mode is entered, an extra link is created in the second TMP object. This link has the same ID as the last link before the text break, and it contains a series of non-printable characters. The size and position of the extra link is unpredictable (although it is consistent between runs if the text isn't changed in edit mode), and every time the text is edited, it moves. When switching between play/edit modes, the extra link's position resets to its original position. The blue boxes in the image below are drawn by the TMP_Text Info Debug Tool script from Examples & Extras, and they mark the position of links.

    Text Input:
    Screenshot from 2023-01-31 14-40-21.png
    Result (after entering, then exiting play mode):
    Screenshot from 2023-01-31 14-43-19.png
     

    Attached Files:

    Last edited: Jan 31, 2023