Search Unity

Does not genearte an altas and drops a bunch of warnings

Discussion in 'UGUI & TextMesh Pro' started by EyeDev44, May 13, 2022.

  1. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Hello, I've tried to generate TMP assets for some fonts. I'd selected Unicode range - but atlases still were empty.
    https://imgur.com/a/aC7dhxB

    Besides, editor revealed 50 warnings
    Code (CSharp):
    1. Unable to add the requested character to font asset [MYRIADPRO-REGULAR SDF]'s atlas texture. Please make the texture [MYRIADPRO-REGULAR SDF Atlas] readable.
    Ok I set it through debug settings to readable, but nothing changes. Then I try to re-generate atlas, it's still completely empty and contains 0 symbols, and readable options set back to false.

    I use Unity 2021.3 and TMP 3.0.6

    This service shows that the source font actually conatains characters that TMP marked as "missing": https://fonts.adobe.com/fonts/myriad#fonts-section

    Unity editor just dropped me 20 times next error
    Code (CSharp):
    1. MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. TMPro.TMP_FontAsset.TryAddCharacterInternal (System.UInt32 unicode, TMPro.TMP_Character& character) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_FontAsset.cs:2063)
     
    Last edited: May 13, 2022
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When selecting Unicode Range, you have to enter a range otherwise, nothing will be added.

    Can you list the a few of the characters that you are trying to add?

    The errors are likely the result of trying to create a font asset with no glyphs in it. This should go away as we add characters.
     
  3. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Find a temporary decision by generating custom unicode range: 0400-04FF,0020-007E
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595