Search Unity

TextMesh Pro [SOLVED] Play defaults to "Font material" resulting in hidden or scrambled text

Discussion in 'UGUI & TextMesh Pro' started by UNSH, Jan 20, 2020.

  1. UNSH

    UNSH

    Joined:
    Jul 2, 2012
    Posts:
    51
    Hi,

    So some fonts are hidden or scrambled because of the wrong material being assigned on play and in build.

    I'll sum up my findings:
    1. The problem seems arbitrary, but once GameObject is affected the font doesn't show even if I delete and re-add the component.
    2. I can set the material in the inspector but on Play it just defaults to "Font material". Resulting in this Warning: Selected Shader does not support Stencil Masking. Please select the Distance Field or Mobile Distance Field Shader
    3. If I change a setting on the component (in Play) the text switches to the correct material and the problem is solved. Similarly if I set the Bold state of a font to use a different text asset and use bold the problem doesn't appear. I haven't tried but I think I can write a workaround like that, but that doesn't seem like the way to go.
    4. Also it doesn't seem to make a difference if the object is disabled on startup or not.
    5. The text object has also an even scale of 1 in the rect transform and in the font settings that is not changed
    6. Even if I use the default Liberation font the problem remains.
    We are using TMP 1.4.1 from the package manager and Unity 2018.4.10f and have not migrated (at least I think so if we have then we have deleted it some years ago)

    Edit 1 : As usual two minutes after the post you find more, it has something to do with I2 Localize.

    Edit 2 : And two minutes after that you find the solution. So for anyone with the same issues and TMP & I2. The issue is caused by the secondary terms set to a font reference, just set them to <None>
     
    Last edited: Jan 20, 2020