Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

TextMesh Pro Version 1.4.1-Preview 1 with Dynamic SDF for Unity 2018.3 now available!

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Stephan_B, Jan 31, 2019.

  1. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    257
  2. JeromeHdz

    JeromeHdz

    Joined:
    Mar 7, 2019
    Posts:
    4
    Oh okai got it, thank you very much for your quick answer!
     
  3. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    128
    I started a new project and upgraded from 1.3 to 1.4.3a with no errors.

    Tested my project again with deleting the com.unity.textmeshpro@1.4.0-preview.3a folder from the cache as well, still the same issue.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Can you provide me with a repro of this project? Easiest way is to submit a bug report that includes the project and then provide me with the case #.
     
  5. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    128
    Tested this on another project of mine and had the same issue.
    I think I worked out the issue, once I removed the Incremental Compiler package it managed to install without any errors.
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    I would suggest reporting this behavior to the author of that Incremental Compiler package.
     
  7. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    128
    After investigating further it seems like the Incremental C# Compiler has been deprecated as they say that from 2018.3 the performance is close to what it achieved anyway... so I've just removed it from the project.
     
  8. fben

    fben

    Joined:
    Oct 24, 2015
    Posts:
    6
    Last edited: Mar 13, 2019
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Can you please make a separate thread / post about this since it is not specific to version 1.4.0?

    In that post, please provide additional insight on what "this value is"? Do you mean what glyph TMP was unable to find which was eventually replaced by a space?
     
  10. JeromeHdz

    JeromeHdz

    Joined:
    Mar 7, 2019
    Posts:
    4
    Sorry for the miss posting on the wrong thread I created a new one and you can erased my post to avoid to encumber this one.
     
    Last edited: Mar 13, 2019
    Stephan_B likes this.
  11. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    340
    @Stephan_B Will there be a version of TMP where it doesn't rely on Resources?
    There are a few downsides about resources, not breaking the application but they do cause inefficiency.
    For any change in the resources folders I would have to rebuild the application. If they were in an asset bundle I would be able to just update the asset bundles on the server and won't need to make a new build.
    They are processed every time you create a build.

    I tried moving them outside the Resources folder to make them addressable in a bundle but then you'd get other errors loading the fonts because it relies on Resources.
     
  12. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    The problem is that Unity doesn't have any API that allows loading resources at Runtime synchronously outside of the Resources.Load which has the requirement of the assets being located in a Resources folder.

    I will be adding a callback to allow loading resources from Asset Bundles. I still have to experiment with that.
     
  13. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,101
    This looks good but I had a previous issue with using TextMeshPro on size critical projects in that resources (like an example font in Resources) and sprites got exported just by importing TextMesh Pro package even if the project didn't use them - is this due to be fixed?
     
  14. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Installing the TMP package, does not add any resources that would be included in a build. So unless you import the TMP Essential Resources and the TMP Examples & Extras which each include a Resources folder with TMP resources in them, no TMP related resources will be added to a project / build.

    If you have lots of font assets and sprite assets but do not use all of them in the project, you can move those outside of a Resources folder to make sure they are not included in a build.
     
  15. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,101
    Well that is the thing, when you go to make a font it suggests installing TMP Essential Resources which includes Font resources like a LiberationSans SDF which are not essential and Emoji sprite assets. So do I need any of those resources or not? (also has a 2016 user guide)
     
  16. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    The TMP Essential Resources are essential hence the name.

    Once you have imported the TMP Essential Resources, in the TMP Settings file, you can replace the LiberationSans SDF as the Default Font Asset and replace the EmojiOne as the Default Sprite Asset. Make sure you assign replacements for them as newly created text objects need some font asset. Once you have done so, you can move those assets outside the Resources folder. I would suggest keeping them around and if they are outside a Resources folder, they will not get included in builds.

    The user guide is still mostly applicable but old indeed. New docs are being worked on.
     
    andyz likes this.
  17. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    Does anybody know how to fix editor becoming irresponsive after updating from 1.3.0 to 1.4.0?
     
  18. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Can you provide more insight on this? This is the first report of something like that.
     
  19. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    Unitu 2018.3.9f1, after updating to 1.4.0 with Package Manager, Editor stops responding when we try to open TextMeshPros settings or enter play mode
     
  20. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Are you getting errors in the console?

    Can you provide a Repro of the project or submit a bug report with the project so I can take a look at this?

    Like I said, this is the first report of this so I am not sure why / what might be causing this behavior.

    If you submit a bug report, please provide me with the case #. If you provide a repro via direct link in a PM or something make sure the link is private and all.
     
  21. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    No errors, whole window just gets not responding.
    I don't really know what causes it, and uploading 10gb project doesn't sound really nice for me.
     
  22. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    I can understand that submitting a bug report which includes the project can be time consuming. However, most of the time this ends up being the fastest way to help reproduce and ultimately resolve potential issues.

    Let's see if we can figure out what might be happening without a project to look at.

    (1) When you reference the Settings, are you talking about the TMP Settings or any text object inspector?

    (2) If you create an empty scene and then add a TMP object to it, do you get the same behavior? or does this seem to happen only with specific objects?

    (3) Were you using the same version of Unity prior to upgrading to version 1.4.0?
     
  23. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    1. After clicking on "Project Settings"
    2. Will test tomorrow, probably it depends on project, since one of my teammates is also getting this
    3. Yes (and btw. I've tried earlier with 2018.3.7f1 and preview 2, same behaviour)
     
  24. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    To isolate the Project Settings vs specific TMP stuff, see if manually navigating to the TMP Settings which are typically located in "TextMesh Pro/Resources/TMP Settings" allows you to look at the TMP Settings without any issues.

    If that works fine then we know the issue isn't with the TMP Settings but with the Project Settings part of this. Sort of narrowing down our search of where the issue my come from.
     
  25. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    But it also does that when starting the play mode
     
  26. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Still trying to figure out what the cause of the issue might be so we have to look / guess and use process of elimination to rule out / isolate different parts.

    So back to my earlier question, are you able to manually select the TMP Settings in the Project tab and inspect it without any issues?
     
  27. PetrisPeper

    PetrisPeper

    Joined:
    Nov 10, 2017
    Posts:
    20
    I'll see tomorrow, it's midnight for me now
     
  28. evilock

    evilock

    Joined:
    Sep 19, 2016
    Posts:
    12
    No idea if this might be related, but looks like I'm having my automated builds occasionally getting stuck with 1.4.0 upgrading the font assets. This is the last thing in the output:

    20:40:31 (Filename: Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs Line: 1720)
    20:40:31
    20:40:31 Upgrading font asset [Revolt SDF] Glyph Adjustment Table.
    20:40:31 UnityEngine.DebugLogHandler:Internal_Log()
    20:40:31 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    20:40:31 UnityEngine.Logger:Log(LogType, Object, Object)
    20:40:31 UnityEngine.Debug:Log(Object, Object)
    20:40:31 TMPro.TMP_FontAsset:UpgradeGlyphAdjustmentTableToFontFeatureTable() (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs:1862)
    20:40:31 TMPro.TMP_FontAsset:InitializeDictionaryLookupTables() (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs:567)
    20:40:31 TMPro.TMP_FontAsset:ReadFontAssetDefinition() (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs:602)
    20:40:31 TMPro.TMP_FontAsset:UpgradeFontAsset() (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs:1847)
    20:40:31 TMPro.TMP_FontAsset:Awake() (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_FontAsset.cs:482)
    20:40:31 UnityEditor.SceneManagement.EditorSceneManager:OpenScene_Injected()
    20:40:31 UnityEditor.SceneManagement.EditorSceneManager:OpenScene(String, OpenSceneMode)
     
  29. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Does everything appear to work correctly in Unity itself? Can you create manual builds in Unity?
     
  30. evilock

    evilock

    Joined:
    Sep 19, 2016
    Posts:
    12
    Yes, everything seems to work fine within the editor.
     
  31. evilock

    evilock

    Joined:
    Sep 19, 2016
    Posts:
    12
    One more issue, on an input field with Ellipsis overflow mode, the text field goes blank (as in doesn't render) when I enter a chinese character that should render from my dynamic fallbacks. Other overflow modes seem to work as expected.

    Also further input causes this error:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    TMPro.TMP_InputField.GenerateCaret (UnityEngine.UI.VertexHelper vbo, UnityEngine.Vector2 roundingOffset) (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_InputField.cs:3310)
    TMPro.TMP_InputField.OnFillVBO (UnityEngine.Mesh vbo) (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_InputField.cs:3277)
    TMPro.TMP_InputField.UpdateGeometry () (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_InputField.cs:3215)
    TMPro.TMP_InputField.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@1.4.0/Scripts/Runtime/TMP_InputField.cs:3190)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:198)
    UnityEngine.Canvas:SendWillRenderCanvases()

    I found that omitting the ClearMesh() call on line 2711 of TMPro_UGUI_Private.cs seems to fix this.
     
  32. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    63
    Hi Stephan,

    I'm currently working on the UI animations of our game and I was wondering if there was a way to animate the text alignment, so that the text moves from the center to the left alignment smoothly. I could of course Animate the Bounding box, although this would lead to lots of problems with localization.

    Thank you!
     
  33. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Unfortunately, there is not.

    If I had to implement this, I would start / have TMP layout the text centered. The via a script similar to the Vertex Jitter types, modify / animate the vertices position of the characters on each line.

    In the text info, I would get the first and last character of each line. Then calculate the distance between the first character (origin) to 0 (which would be the same as left alignment) and then move each character on that line that amount. Then repeat the process for each subsequent lines.

    The characters on each line could be moved at uniform speed or animated.

    The same could be done for each lines.

    P.S. I would suggest posting your question in the main forum section (Unity UI & TextMesh Pro) as this is not specific to the Dynamic SDF system and this new release and could be something that other users are interested as well but would not find in this specific thread.
     
    Last edited: Mar 26, 2019
  34. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    I'll try taking a look tomorrow and provide feedback thereafter.
     
  35. deviant-dev

    deviant-dev

    Joined:
    Nov 18, 2017
    Posts:
    5
    Hmm... I just upgraded from Unity 2019.1.0b8 to Unity 2019.1.0b9 and am getting that "wrong return type" error as mentioned earlier in this thread:

    Code (csharp):
    1. Library\PackageCache\com.unity.textmeshpro@2.0.0\Scripts\Editor\TMP_SettingsEditor.cs(332,91): error CS0407: 'Object TMP_ResourceImporterProvider.GetTMPSettings()' has the wrong return type
     
  36. deviant-dev

    deviant-dev

    Joined:
    Nov 18, 2017
    Posts:
    5
    Aha! Deleting the library fixed it. So strange that it happened in the first place.
     
  37. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Although rare, I have run into similar situations where the assemblies for the package didn't get compiled correctly when a new package is being installed. As usual, whenever it happens, I am never able to reproduce it afterwards. This is not specific to TMP but to packages which use assembly definitions.
     
  38. evilock

    evilock

    Joined:
    Sep 19, 2016
    Posts:
    12
    Hi Stephan, did you have a chance to look at my Ellipsis issue yet?
     
  39. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    I would I go about reproducing the behavior? Can you provide the steps or a repro project?
     
  40. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    60
    I get NullReferenceException when trying to paste a text...
     
  41. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    I'll need more details / steps to help me reproduce the behavior you are reporting.

    What font asset are you using? What text are you copy / pasting / etc.

    Also is this specific to version 1.4.0 of TextMesh Pro? If not please post in the main forum (Unity UI & TextMesh Pro) since this thread is specific to version 1.4.0 and the new Dynamic SDF system.
     
    unnanego likes this.
  42. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    60
    yes, sorry)

    Actually, I did a test - the problem was when pasting a text with both cyrillic and latin symbols (pasting only one of them doesn't result in the error). I'm using the cyrillic range of symbols from San Francisco Medium font. If using the Roboto asset (does it come with TMP? I'm not sure if I made it or it was already there) the error doesn't appear. Also, the error exists both in latest preview and in final version. 1.4.0 of course
     
  43. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    60
    Also, I keep getting warning about some missing characters like underline and ellipsis, which are not used in the scene, which also didn't happen with 1.3.0. I tried creating a new atlas, it said there were no missing characters, but the warnings still stay - and there's a lot of them.
     
  44. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    60
    Well, I fixed all of it after watching the video on asset creation =)
     
    Stephan_B likes this.
  45. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Glad to know you figured it out.

    P.S. Since this is the thread related to the Dynamic SDF system, another option is to create a dynamic font asset or fallback that where these characters would be added automatically.
     
    unnanego likes this.
  46. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    787
    Just wanted to drop in to say that the upgrade worked perfectly fine for our project. Good job!

    Quick question though:
    Are there any improvements planned for rendering of smaller font sizes?
    Event "Hinted Smooth" is far from the crisp yet anti-aliased rendering like this:
    upload_2019-4-3_12-52-41.png

    I thought I heard TMP might be used in the editor at some point, so I guess that's on the agenda somewhere?
     
  47. evilock

    evilock

    Joined:
    Sep 19, 2016
    Posts:
    12
    Ah, doesn't seem to be an issue after all. Can't reproduce it exactly anymore but I'm suspecting something at my end was causing an extra line break in the input. The steps for reproducing IndexOutOfRangeExceptions in editor would be just to have the value in an input field start with an empty line:

    1) Create a TMPro Inputfield
    2) In "Text" Inspector, set Overflow to Ellipsis
    3) In "Text" Inspector, in the Text Mesh Pro UGUI text area, press enter and enter any text -> bang
    4) Clicking the text in play mode -> bang

    Again, probably not a real-life scenario but just in case you want to have a look.
     
  48. psypol

    psypol

    Joined:
    Dec 20, 2013
    Posts:
    24
  49. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Only the Mesh Filter / Mesh should remain which is something the prefab team needs to fix since it is not related to TMP but to the Mesh Filter component.
     
  50. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,050
    Please create a separate thread which will make it easier to have a discussion about this topic.