Search Unity

Feature Request Annoying message "Auto Size Iteration Count: 100. Final Point Size..."

Discussion in 'UGUI & TextMesh Pro' started by denis_bogdanov, Apr 4, 2022.

  1. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144
    Hello!

    Please add a function to disable the message "Auto Size Iteration Count: 100. Final Point Size..."

    Thanks in advance
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of the TMP package are you using?

    This message should not be displayed.
     
  3. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144
    "com.unity.textmeshpro": "3.0.6" [Verified]
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I had a chance to look into this and this message is displayed when the iteration count exceeds 100.

    We actually do not want to suppress this message as this is indicative of some potential issue with regards to the values you are using as typically iteration count should be between 8 -12. The higher the iteration count the higher the performance overhead so we want to figure out what is going on here to get this back to a normal range.

    Can you post an image of the values you are using for point size and the min and max range?
     
    denis_bogdanov likes this.
  5. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144

    I will describe the problem and how I solved it. But a little later, when I'm free.
     
  6. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144

    Hello!

    I did the bottom bar. Text with "overflow" = "Ellipsis


    Sequencings:

    1) Font size 45, all fine, but for Latin and Cyrillic characters...
    1.png

    1a.png

    2) With Asian characters the text is not visible on some devices (it depends on the height of the component "TextMeshProUGUI")
    Screenshot_2.png

    3) I enabled "AutoSize" min = 1; max = 45. But then "Ellipsis" doesn't work

    Screenshot_3.png
     

    Attached Files:

  7. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144
    4) But if I set "WD%" = 0.5 everything works fine and with Asian characters
    Screenshot_4.png Screenshot_5.png

    5) But now an annoying message "Auto Size Iteration Count: 100. Final Point Size..."

    6) I did this: "AutoSize" = false; "FontSize" = 45; "Overflow" = "Ellipsis" and added code and everything works fine and the message "Auto Size Iteration Count: 100. Final Point Size..." does not appear
    Screenshot_6.png




    I would like to hear your comments, maybe I did something wrong

    Thanks in advance
     
    Last edited: Apr 9, 2022
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Since fonts come in all shapes and sizes, you may have to normalize some of the Face Info metrics of your Asian / fallback fonts to match those of your primary font asset.

    For instance, NotoSans has an Ascent Line that is much higher than Liberation Sans. As such, if the text object's Overflow mode is set to Truncate or Ellipsis, it could result in those Asian characters being truncated because they don't fit in the given height of the text container.

    To adjust / normalize the Face metrics, add the TMP_TextInfoDebugTool.cs script to one of your text components. This script is contained in the TMP Examples & Extras and will enable you to visualize those metrics.

    Below is an example showing the difference between the Ascent and Descent lines between Liberation Sans and NotoSans CJK.

    upload_2022-4-11_21-32-24.png

    To normalized / adjust these metrics, simply select the font asset you are using for CJK text and adjust the Ascent and Descent lines to match those of your primary font asset which is Inter.

    Below is an example of the same text as above but with adjust face metrics.

    upload_2022-4-11_21-35-27.png

    Also note that text alignment is based on these metrics. As such, when using top vertical alignment, the text would be positioned where the tallest ascender is align with the top of the RectTransform. If the first line of text first contained characters from Inter and then subsequently followed by some characters from NotoSans CJK, you would notice the text shifting down vertically as it would not be aligned with the taller Ascent line from NotoSans. This is another reason to normalized those metrics to avoid these potential shifts due to fonts having varying metrics.

    Normalizing your font assets should stop the CJK characters from disappearing.

    In terms of Auto Size and the iteration count, I suspect is it due in part with the above and a min value that is too small. I would recommend making sure that you use somewhat valid ranges which would be between 8 to some higher value.

    Let me know if the above helps.
     
    denis_bogdanov likes this.
  9. denis_bogdanov

    denis_bogdanov

    Joined:
    Apr 20, 2015
    Posts:
    144

    Thanks for the detailed answer.
    I will take your advice
     
  10. xelat_unity

    xelat_unity

    Joined:
    Jan 4, 2023
    Posts:
    1
    Could you please then at least add affected GameObject name into log message, and specify this gameobject (or component) as last argument for Debug.Log() call? Because now it's actually not much informative when it happens, as it just state that "somewhere in the project we have issues". We need a way to find such problematic places and fix them.
    Thank you.