Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TextMesh Pro Font Source File (m_SourceFontFile_EditorRef) is null in newly created FontAssets in 1.4.0

Discussion in 'UGUI & TextMesh Pro' started by CanisLupus, Apr 3, 2019.

  1. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    For us, even in an empty Unity Project with TMPro 1.4.0, creating a new font asset via the Font Asset Creator causes the Source File of the font asset to be None.

    Changing the Atlas Population Mode to Dynamic at this point causes an error as the system tries to copy the m_SourceFontFile_EditorRef variable to m_SourceFontFile, since it's null (this is a guess from looking at the inspector in Debug mode).

    Setting the Source Font File manually and only then changing to Dynamic works. However, if we change to Dynamic first (getting the error I mentioned above) and then add the Source File manually, m_SourceFontFile will remain null, causing any dynamic generation of characters to fail from then on. Changing to Static and back to Dynamic fixes this.

    The main problem is the Source File being empty after creation. This also happens in 1.4.0-preview.3a, possibly before.

    Cheers,
    Daniel
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Does it do this with any font file?
     
  3. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    I can try to be certain tomorrow, but it did with at least two completely different fonts, both .ttf. Maybe you hadn't time to try this yet but, if you did, did the problem not happen?
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Thank you for reporting the issue. I was able to reproduce the issue. Please make the following changes.

    upload_2019-4-3_15-0-49.png

    These changes will be included in the next release of the TMP package.
     
    ynaoto likes this.
  5. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Thank you for confirming it and for the quick fix! :)
     
    Stephan_B likes this.
  6. ynaoto

    ynaoto

    Joined:
    Mar 26, 2016
    Posts:
    21
    The latest version TMP 2.0.1 from Package Manager already included the change above?
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    It is not present in version 2.0.1. It will be in the next release which will be 2.1.0 which should be out very soon. I am going through the publishing process right now so within a few days.
     
    ynaoto likes this.