Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Autosize for uppercase is not taking into account diacritics (accent marks, umlaut, etc)

Discussion in 'UGUI & TextMesh Pro' started by lyha, Oct 12, 2020.

  1. lyha

    lyha

    Joined:
    Feb 28, 2016
    Posts:
    15
    Rect is set up to not let symbols go outside the button. But looks like rectangle + autosize combination don't work with uppercase for specific Europian accent symbols.
    It looks like a font specific issue (not all fonts creates same result). Is it possible to recognize and fix it in runtime?

    Unity 2018.4.26
    TMP 1.5.1

     

    Attached Files:

  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Text layout is driven by the font metrics. As such, if a font has an Ascender set near the top of capital letter where the accents are above this ascender then it will behave as you have shown.

    I would suggest adding the TMP_TextInfoDebugTool.cs script to this text object. This script is found in the TMP Examples & Extras. This script will enable you to visualize these text / font metrics which you can adjust in the font asset inspector. This would enable you to adjust this font to adjust its ascent line to include the accents.
     
    lyha likes this.
  3. sammmyy2211

    sammmyy2211

    Joined:
    Oct 13, 2020
    Posts:
    1