Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Show Text Bounds shows a larger bounds than display

Discussion in 'UGUI & TextMesh Pro' started by haolly, Jul 23, 2018.

  1. haolly

    haolly

    Joined:
    Sep 8, 2015
    Posts:
    15

    https://imgur.com/I1SljD2

    as you can see in the image
    I use the script TMP_Text Info Debug Tool to show the bounds.
    So, what wrong with it?
    The textMesh Pro object not scaled, and the pivot is at (0.5, 0.5), the anchor is in top left
     

    Attached Files:

  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you check if you get the same results using different text?

    Can you provide me with a script example that will reproduce the behavior?
     
  3. haolly

    haolly

    Joined:
    Sep 8, 2015
    Posts:
    15
    Use different text or different font have the same problem. And I do not use any script, just put text in the textmesh Pro UGUI component, see the image : textmeshbounds.png

    seems like the position is not right also :(
     
  4. haolly

    haolly

    Joined:
    Sep 8, 2015
    Posts:
    15
    textmeshbounds.png

    The calculated bounds position changed when I change the textmeshPro UGUI 's pivot to top-left, but it still bigger than expected:(
     
    Last edited: Jul 24, 2018
  5. haolly

    haolly

    Joined:
    Sep 8, 2015
    Posts:
    15
    textmeshbounds.png

    I also found the Example 22 "Basic Script Example" in the textmeshPro package show larger bounds using "TMP_text info debug too.cs"
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of TextMesh Pro are you using?
     
  7. haolly

    haolly

    Joined:
    Sep 8, 2015
    Posts:
    15
    version 1.2.2, unity 5.5.4f1
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I'll try looking into this tomorrow and post about my findings shortly thereafter.