Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

TMP AutoSize performance vs UGUI's BestFit?

Discussion in 'UGUI & TextMesh Pro' started by vexe, Apr 9, 2018.

  1. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    Greetings,

    was just wondering if TMP's AutoSize feature has any serious performance impacts like UGUI's BestFit? It seems to work very well even with Bitmap Fonts which is a plus. But just not sure about performance. Is it literally just fiding the nearest font size that fits the transform rectangle?

    Thanks
     
    Yamaguchi_NHNJP likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Text Auto-sizing in general is expansive as multiple point sizes have to be tested to find the correct fit.

    Since the TMP Text Auto-sizing is much higher precision 0.05 point size increment vs 1.0 point for UGUI, it has a higher cost.

    Text Auto-sizing is a nice feature but not something that should be used on all text objects. Text auto-sizing should be use to test / find the optimum point size on a single text object (usually with the longest word or most amount of text) and then disabling auto-sizing and applying this optimum point size on all text objects. This ensure best performance and uniformity of point size between all the text objects which otherwise would be bad from a UI design point of view.
     
    kyubuns and vexe like this.