Search Unity

TextMesh Pro Tab character U+0009 : <control-0009> causing text to misbehave

Discussion in 'UGUI & TextMesh Pro' started by FernandoHC, Jun 12, 2019.

  1. FernandoHC

    FernandoHC

    Joined:
    Feb 6, 2018
    Posts:
    338
    Hello,

    I'm having issue with the tab character: U+0009 : <control-0009> (CHARACTER TABULATION [TAB]) {horizontal tabulation (HT), tab}
    Whenever this is used by players in the game chat, the entire chat line preceding and exceeding the tab character is wrapped into the previous/next line. As can be seen in the screenshot.

    Capture.PNG

    if I copy-paste the text, from within the tmp inspector this is what I get:
    Code (CSharp):
    1. 08:26 1 2 /Jun/2019    You have gained 290 asd asd as das a from the auction sale of Spirit Tainted Boots to the player S
    (I don't know if the forum will bring the same ucodes as I get in the game)

    If I put the characters through unicode list, this is what I get:
    Code (CSharp):
    1. U+0030 : DIGIT ZERO
    2. U+0038 : DIGIT EIGHT
    3. U+003A : COLON
    4. U+0032 : DIGIT TWO
    5. U+0036 : DIGIT SIX
    6. U+0020 : SPACE [SP]
    7. U+0031 : DIGIT ONE
    8. U+0032 : DIGIT TWO
    9. U+002F : SOLIDUS {slash, virgule}
    10. U+004A : LATIN CAPITAL LETTER J
    11. U+0075 : LATIN SMALL LETTER U
    12. U+006E : LATIN SMALL LETTER N
    13. U+002F : SOLIDUS {slash, virgule}
    14. U+0032 : DIGIT TWO
    15. U+0030 : DIGIT ZERO
    16. U+0031 : DIGIT ONE
    17. U+0039 : DIGIT NINE
    18. U+0009 : <control-0009> (CHARACTER TABULATION [TAB]) {horizontal tabulation (HT), tab}
    19. U+0059 : LATIN CAPITAL LETTER Y
    20. U+006F : LATIN SMALL LETTER O
    21. U+0075 : LATIN SMALL LETTER U
    22. U+0020 : SPACE [SP]
    23. U+0068 : LATIN SMALL LETTER H
    24. U+0061 : LATIN SMALL LETTER A
    25. U+0076 : LATIN SMALL LETTER V
    26. U+0065 : LATIN SMALL LETTER E
    27. U+0020 : SPACE [SP]
    28. U+0067 : LATIN SMALL LETTER G
    29. U+0061 : LATIN SMALL LETTER A
    30.  
    So we can see when I use U+0009, it goes back to check for the first space, then creates a new line, then creates a new line at the tab. Resulting in what we see in the screenshot.

    SO, finally, on top of that issue (causing new lines for tab instead of a simple space), the Wrapping calculation is also affected, causing the text to be out of bounds as it can be seen in the image, the text is within a Vertical layout group, that works fine and expands the wrapping area, however when tab is used it disregards 2 lines.

    I'm using TMP 1.4.1 on unity 2018.4.2