Search Unity

TextMesh Pro Upping sprite glyph scale makes text overflow, despite content size fitter

Discussion in 'UGUI & TextMesh Pro' started by StationErik, Jul 26, 2019.

  1. StationErik

    StationErik

    Joined:
    Feb 28, 2019
    Posts:
    2
    I'm having a problem where I have a tooltip window with horizontal layout group as well as a content size fitter. This works well, even with <sprite> inserted into the text. However, if I increase the glyph scale of the sprite, the content size fitter does not adjust to the new sprite mesh. The images below should explain my problem better.

    smileA.PNG
    The working tooltip.
    smileB.PNG
    Upping the glyph scale to 2...
    smileC.PNG
    ...makes the text overflow.
    smileD.PNG
    This is the wireframe of the new text's mesh, and the tooltip mesh behind it.

    Anyone got an idea of how to fix this? Is it a bug or am I misundertanding something? Any help very appreciated!
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,950
    Bring up the Layout Properties on the text object as seen below and see if the Preferred Width changes when you modify either the sprite character's scale or the sprite glyph's scale.

    upload_2019-7-26_1-36-28.png

    I just tested in the version of TMP that I am working on (version 1.4.2 / 2.0.2) and the preferred width updates correctly.

    What version of the TMP package are you using?
     
  3. StationErik

    StationErik

    Joined:
    Feb 28, 2019
    Posts:
    2
    The sprite character scale made it work. Thanks! That made the preferred width update. The glyph scale did not, however.
    The version is 2.0.1
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,950
    Sprite Glyph scale will be working as expected in the next release.
     
  5. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    287
    Can we expect this fix/release any time soon? Just had some very strange layout bugs and it took a while to narrow it down to the sprites, and then to find this workaround :)
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,950
    Have you tested with the latest release of TMP which is version 2.1.0-preview.3?
     
  7. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    287
    I haven't - we're on 2.0.1 but Package Manager says that's up to date. Is 2.1.0p3 2019.3 only or something? We're on 2019.2 - if it's available for 19.2 I'll happily grab it
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,950
    In the Advanced tab of the Package Manager window, you have to select Show Preview Package. This will enable you to see the latest version which is 2.1.0-preview.3.
     
  9. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    287
    Preview packages was enabled - it didn't show. I've manually updated the manifest and it's all good, but FWIW it still says I should "upgrade" to 2.0.1

    We're not on the latest patch for 2019.2, which I suspect might be the cause. Thanks for letting me know the current version though :)
     
unityunity