Search Unity

New TMP font asset not behaving!

Discussion in 'UGUI & TextMesh Pro' started by Fu11English, Aug 22, 2021.

  1. Fu11English

    Fu11English

    Joined:
    Feb 27, 2012
    Posts:
    258
    I have built a UI with a TMP font asset which is all fine and correct. But then I have decided to switch to a different font. So I have built a new TMP font asset from a different source font. When I switch a UI objects text to the new one it misbehaves!

    For example, the new font will not centre vertically, even though all the relevant settings are correct. Also changing the underline thickness and height doesn't do anything at all.

    Those are just two things I have immediately noticed, there may be more. Am I missing something or is my font or TMP bugged?

    EDIT - I just tried making another font at complete random and that does exactly the same. So it seems the only font which works correctly is the one I initially made in my project?

    Cheers!
     
    Last edited: Aug 22, 2021
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Fonts have different metrics and as such can align differently especially if the ascent and decent lines are very different than your previous font.

    if you provide me with the name and link to the font file you are using, I can provide more details.
     
  3. Fu11English

    Fu11English

    Joined:
    Feb 27, 2012
    Posts:
    258
    I see!

    The name is 'Arial Monospaced MT Std Bold'

    Link - here

    Another question. With my original font I could change the underline height and thickness and it would update in real time in the editor view. But the new font doesn't do that, I have to toggle underline off and on in the inspector for it to show the changes in thickness or height. That's why I was thinking there is a bug or something?
     
    Last edited: Aug 22, 2021
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    How did you create your new font asset? Did you use the Font Asset Creator or did you select the font file and then use the "Create - TextMeshPro - Font Asset" context menu option?

    Can you post a screenshot of your font asset inspector so I can see the Face Info along with Generation Settings?

    Just to double check on my end, I will create a font asset using the above font and see if I can spot any issues and report my findings.

    EDIT: I downloaded the above font and created a dynamic font asset from it using the create font asset context menu and had no issues changing the Underline Offset and Thickness.

    P.S. I would suggest watching the following two videos if you haven't already done so as these might provide you with valuable additional information.



     
    Last edited: Aug 23, 2021
  5. Fu11English

    Fu11English

    Joined:
    Feb 27, 2012
    Posts:
    258
    Yes I went to Window/TextMeshPro/FontAssetCreator.

    I have since started again and create the asset by the right click menu on the source font. Now things are working!

    For the vertical centering I had to switch from middle to capline to get that to work. My original font used middle but with the new font that option makes the text well above centre.

    Thanks!