Search Unity

TextMesh Pro Detect missing character at run time in code?

Discussion in 'UGUI & TextMesh Pro' started by LesBloom, Apr 1, 2021.

  1. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Hello,

    I am trying to find a way to detect when a missing character is trying to be rendered with Text Mesh Pro.

    That is, I set the text value, display the text, and one of the place holder squares is displayed. But, I need to be able to detect this at run time via my code.

    Is there an exception, flag, property, or something else that I could be looking for?

    Thanks
    Les
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You can use one of the TMP_FontAsset.HasCharacters() function.
     
  3. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Thank you, @Stephan_B . I will try that out.

    I am creating a basic tool that will iterate all my strings against all supported languages, and trying to detect if there are any errors.

    Cheers