Search Unity

TextMesh Pro Can't create font assets.

Discussion in 'UGUI & TextMesh Pro' started by VJokipii, Feb 19, 2020.

  1. VJokipii

    VJokipii

    Joined:
    Oct 17, 2019
    Posts:
    1
    Hi, so, i cannot seem to be able to create a font asset with the TextMesh Pro font asset creator. I downloaded 4 different fonts, i imported them to unity, and i dragged each one in the font asset creator. I hit 'Generate Font Atlas' and i just keep getting this error, no matter what i do. (Change the location of the font files, change the settings in the font asset creator etc.)

    Font Asset Creator - Error Code [Invalid_File_Path] has occurred trying to load the [DPCOMIC] font file. This typically results from the use of an incompatible or corrupted font file.

    The files are in .ttf (which is told to be the correct file type to use everywhere i looked), and work perfectly fine in other softwares such as wordpad.

    I have been using unity and other software for most of my life, and this is the first time ever i am posting on a forum, because i simply cannot seem to find the answer to this. I am 99% certain at this point that this is an idiotic problem and i just missed something obvious here.
     
    Meltdown likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See the following video about the Font Asset Creation process. Perhaps it will allow you to figure what step you might be missing.

    Make sure you import these .ttf files in your Unity project.

    If possible, please provide me with a link to one of those font files and I can verify they are in fact working font files.

    P.S. Make sure you import the TMP Essential Resources and optionally but strongly recommended the TMP Examples & Extras. To import these, go to the Window - TextMeshPro - Import ... menu.
     
    Meltdown and Only4gamers like this.
  3. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Hello,
    can i create Font asset/atlas from Unity Arial font? as I can't able to create. When I am clicking generate nothing is happening and there is no error in Console.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There should be a warning in the console indicating we were not able to load this font.

    Why are we not able to load this font?

    This Arial font object is not actually Arial. The font name is Arial which results in the Legacy text system searching for a font by the name Arial on your operating system. If it finds it then it uses it otherwise, it goes through some hidden list of font names to try use one of them instead. This results in some other font being used on different platforms which you only discover later after publishing to those platforms.

    Solution, do not use this Arial font and instead pick your own font.

    This Arial font also leads to people thinking it supports other languages when it does not. It appears to support other languages because again behind the scene some other font ends up being used where this varies per platform.

    Dynamic OS Font Assets will be introduced in the next minor releases of the TMP package. This type of font assets will enable users to use System / OS fonts available on the different platforms and to specific which ones to use and on which platform. See the following post about this.
     
    Only4gamers likes this.
  5. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Thank you so much for all info. I didn't know this all.
     
  6. cfazilleau

    cfazilleau

    Joined:
    Apr 10, 2019
    Posts:
    6
    I got this [Invalid_File_Path] error too. The problem was that I tried to generate a font whose assets were outside of the Assets folder (they were in a package)
    If you get this error too, try moving your files in the Assets folder to generate them, before moving them back to where they should be :)
     
  7. ttw1993

    ttw1993

    Joined:
    Jul 19, 2017
    Posts:
    11
    thank you ,you are right
     
    rumin5155 likes this.
  8. zqchary1234

    zqchary1234

    Joined:
    Jul 26, 2021
    Posts:
    1
    I tried doing this nothing happen could you make a video on how you did i have been stock on trying to generate the font for so long now
     
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Is your font file located in the project itself?

    The following videos should prove useful. Although they are not specific to this issue, the do provide extensive insight on the font asset creation process.