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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Text Mesh Pro - The Ultimate Text Solution for Unity - Powerful & Flexible - Advanced Text Rendering

Discussion in 'Assets and Asset Store' started by Stephan-B, May 29, 2014.

Thread Status:
Not open for further replies.
  1. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I am in Iceland right now with limited access but I'll look into this upon my return on Sunday. Since you have the paid version and access to the TextMesh Pro user forum please make a post there in the support section which will make this easier to track and for use to communicate about it.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Send me a PM and upon my return from Iceland, I'll get you one of the previous version of the Shaders for testing on the 3DS.

    The PM is to make it easier for me to track the request.
     
  3. Apoll0

    Apoll0

    Joined:
    Jun 11, 2015
    Posts:
    16
    Hello!
    I've got an error in the console while implementing TMP in my project:

    TypeLoadException: Could not load type 'UnityEngine.AdditionalCanvasShaderChannels' from assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    TMPro.TextMeshProUGUI.OnPreRenderCanvas ()
    TMPro.TextMeshProUGUI.Rebuild (CanvasUpdate update)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:149)
    UnityEngine.Canvas:SendWillRenderCanvases()

    Unity 5.5.2f1

    I tried to reinstall Unity and TextMesh Pro, created empty project and imported TMP, but nothing changed.
    This error repeats every time I change text in TEXT INPUT BOX. And there is nothing change in the scene/player view
     
  4. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Ok I have sent a PM. I am waiting for the shaders.
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    In Unity 5.6, the Canvas needs to be set to use the correct vertex attributes. Ie. Texcoord1, Tangents, Normal, etc... In the latest release of TextMesh Pro, there is a compiler conditional to handle this since this is only required for Unity 5.6.

    For some reason, in your case, Unity is getting tripped up. I believe this could be reverse of the Asset Store bug where you got the release for Unity 5.6 instead of the one for Unity 5.5. Is it possible that you logged in to Unity using Unity 5.6 and then switched back to Unity 5.5 without logging out and then downloaded TextMesh Pro? If so, load Unity 5.5 and then log out. Then log back in using Unity 5.5 and you should be getting the right version of the TextMesh Pro from the Asset Store now.
     
    Last edited: Apr 6, 2017
  6. Good_Venson

    Good_Venson

    Joined:
    Oct 12, 2014
    Posts:
    22
    On a blank project after importing TextMesh Pro from the asset store window, I am getting the following error:
    Deleting theTextMesh Pro folder, and re-importing from the asset store has no effect. I am using Unity 5.4.3.
    I am not getting this error in Unity 5.6.0.

    I am really excited about this being released for free. I've been following the asset for years it seems, but I'm pretty poor, so I was stuck wishing until now, haha.
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    There are separate releases of TextMesh Pro for Unity 5.3 / 5.4 / 55 and 5.6. This means that you need to make sure you get the correct version of TMP for each version of Unity. Due to this Asset Store bug, make sure you log out and then log in using the version of Unity you want to pull from the Asset Store.

    So while using Unity 5.4, log out and then back in and then download from the Asset Store. While in Unity 5.6, log out and then back in to get the release for Unity 5.6. As far as I am told by the Asset Store folks, this should work,
     
  8. Good_Venson

    Good_Venson

    Joined:
    Oct 12, 2014
    Posts:
    22
    Yeah, that didn't work, unfortunately. I'll try to figure it out, but in the meantime, I guess I'll just use Unity 5.6, even if it is a little buggy. Thanks for the quick response :)
     
  9. WilsonCWong

    WilsonCWong

    Joined:
    Mar 20, 2013
    Posts:
    32
    Hi,

    I'm on Unity 5.6.0f3 and when I import the latest version of TMP, I get this error in the console:
    NullReferenceException: Object reference not set to an instance of an object
    TMPro.TMP_Settings.get_defaultFontAsset ()
    TMPro.TextMeshProUGUI.LoadFontAsset ()
    TMPro.TextMeshProUGUI.OnValidate ()

    It works fine when I press play, but I'm just wondering if this is an issue I should be concerned about or not. Thanks in advance.
     
  10. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This is a known issue which applies specifically to one of the prefabs used in an example and only appears to show up on Import. It should not show up again. Having said that I am still going to investigate why it is happening.
     
  11. Apoll0

    Apoll0

    Joined:
    Jun 11, 2015
    Posts:
    16
    Yes, I really installed Unity 5.5 after downgrade from 5.6.
    Thanks, I'll relog my unity account
     
  12. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    Any insight on how TextMeshPro will be included as the standard text component in Unity 2017?

    Could it just replace standard TextMesh component or provide an option to upgrade existing TextMesh components in a scene ? Would that be feasible? (assuming the behaviour/existing settings can be translated to the new TextMeshPro component.
     
  13. Apoll0

    Apoll0

    Joined:
    Jun 11, 2015
    Posts:
    16
    So, I tried to relog several times, but nothing changed.
    I can't do anything with the TMP (UI), getting the error:
    TypeLoadException: Could not load type 'UnityEngine.AdditionalCanvasShaderChannels' from assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    TMPro.TextMeshProUGUI.OnPreRenderCanvas ()
    TMPro.TextMeshProUGUI.Rebuild (CanvasUpdate update)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:149)
    UnityEngine.Canvas:SendWillRenderCanvases()


    As I understand, I get Unity 5.6 version of TMP, while using 5.5 in the project?
    Any ideas?
     
  14. antx

    antx

    Joined:
    Feb 16, 2012
    Posts:
    28
    Hello,

    Since I have not seen TextMeshPro in the Unity's scripting reference yet, I was wondering if there is a way to figure out at runtime wether a text was elipsed by TMP or not.
    I need to display a "..More" button / link in case the text is too long, but for that I need to know wether TMP elipsed the text on screen or not.

    If this is not yet implemented, perhaps this would be something for the future.
     
  15. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The new component will be different but I will most certainly try to mirror most of the properties so that similar to going from TextMesh to <TextMeshPro> the change in code is mostly just a class name change. For objects created in the editor, similar to how users have created their own scripts to convert from TextMesh to TextMeshPro or from UI.Text to TextMeshProUGUI, something similar could be implemented at the user level or via some script conversion / api updated.
     
  16. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This error makes it clear that you are getting the Unity 5.6 version which obviously won't work with Unity 5.5.

    You did try to load Unity 5.5. Log out of your Unity account. Then close Unity and open Unity 5.5 again and then log on to your Unity account. Ie. perhaps this requires closing Unity for the logging change to take place.

    If this doesn't work, send me an email and I will provide you with the package directly via email.
     
  17. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Code (csharp):
    1. public bool isTextOverflowing;
    Should do the trick along with

    Code (csharp):
    1. public int firstOverflowCharacterIndex;
     
  18. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Stephan, can you point me to the correct direction to download the previous working shaders for new Nintendo 3DS, I need to test my project and I want something working.
     
  19. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Stephan, every time I build the game in N3DS I get these errors:

    Shader error in 'TextMeshPro/Mobile/Distance Field Overlay': C:\Users\...
    Compiling Vertex program with UNDERLAY_ON

    Shader error in 'TextMeshPro/Mobile/Distance Field Overlay': C:\Users\...
    Compiling Vertex program

    Shader error in 'TextMeshPro/Mobile/Distance Field': C:\Users\...
    Compiling Vertex program with UNDERLAY_ON OUTLINE_ON

    Shader error in 'TextMeshPro/Mobile/Distance Field': C:\Users\...
    Compiling Vertex program with UNDERLAY_ON

    Shader error in 'TextMeshPro/Mobile/Distance Field': C:\Users\...
    Compiling Vertex program

    Shader error in 'TextMeshPro/Mobile/Distance Field': C:\Users\...
    Compiling Vertex program

    Any clues?
     
  20. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I suspect the 3DS only supports Shader model 2.0 and as such we will need to reduce the number of parameters passed to the fragment shader. Like I said before, I am in Iceland right now so I don't have access to my full development system but I will be back on Sunday and be able to get you a revised shader for testing which should work.

    For certain tiling / offset support will have to go but I think we should be able to support the rest of the mobile SDF shader features.
     
  21. skrilmps

    skrilmps

    Joined:
    Mar 14, 2017
    Posts:
    11
    I have a TextMeshProUGUI object that is in Paging mode. When it gets to the end (last page) of text, I want to dynamically create a button underneath the last line of text.

    I am having a hard time making sense of the coordinates I get from the characterInfo struct.

    I'm using Unity 5.6

    I am getting the coordinates of the last character of text (I've also tried getting the baseline of the last line) and placing the button's coords down on the y-axis a pre-determined amount and all the way to the left.

    When I get the coords of the last character I do it like this:
    Vector3 bottomLeft = mesh.textInfo.characterInfo [mesh.textInfo.characterCount - 1].bottomLeft;

    This gives me a result of (56.2, -35.3, 0.0). (My Canvas is 300x300, something I arbitrarily set for now). However, if I manually place an object using the Scene Editor and align it with the last character, Unity tells me its RectTransform coords are (206.8, -63.5, 0). These latter coords, whichever coordinate system they're using, seem to agree with the results I get when I dynamically create a button within code. But that is not matching up with the coords I am getting from characterInfo. Why the discrepancy?

    What coordinate system does characterInfo use? I've tried converting the result I get from characterInfo using camera.WorldtoScreenPoint, camera.ScreentoWorldPoint, and transform.TransformPoint, but none of these result in coords that I can make sense of either.

    Thank you for any help!
     
  22. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The information is in local space so you need to factor in the transform position. To help you with this, add the TextInfoDebugTools.cs script to your text object. This will allow you to visualize the data contained in the textInfo class but more importantly allow you to look at the script to see how it is drawing the information.
     
  23. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Another Nintendo 3DS error. In UI screen space camera. I have a 'text mesh pro UGUI' object and when I had an image under it in the hierarchy the object overlapped it and the text could not be seen, now in the editor the text is over everything else even if the images are under it in the hierarchy. This is very annoying.
     
  24. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Make sure you are not using one of the Overlay shader as by design the text would always be over other elements.

    Something else to keep in mind is when mixing text objects where some of them are in Screen space overlay and other in Camera Space or World Space where all these objects share the same material presets. As a material cannot be both in Overlay space and Camera or World space at the same time, you will get unpredictable results. In this case, you need to create / use a Material Preset for the objects in Camera / World Space and one for the object in Overlay space.
     
  25. skrilmps

    skrilmps

    Joined:
    Mar 14, 2017
    Posts:
    11
    Hi Stephan, thanks for your response!

    I've looked at the TextInfoDebugTool script and I see the following line:
    Vector3 bottomLeft = m_Transform.TransformPoint(cInfo.bottomLeft);

    But when I do this in my code, it only changes the z position.

    This code:

    Transform myTransform = gameObject.GetComponent<Transform> ();
    Vector3 bottomLeft = mesh.textInfo.characterInfo [mesh.textInfo.characterCount - 1].bottomLeft;
    print("bottomLeft = " + bottomLeft);
    print("Transformed bottomLeft = " + myTransform.TransformPoint(bottomLeft));

    Produces this result:

    bottomLeft = (56.2, -35.3, 0.0)
    Transformed bottomLeft = (56.2, -35.3, -10.0)

    So the x and y values are unchanged and still have the same issue as before, in that they don't seem to align with the coordinates of my dynamically generated objects. I feel like I must be missing something obvious...? Thank you for your help.
     
  26. skrilmps

    skrilmps

    Joined:
    Mar 14, 2017
    Posts:
    11
    I believe I've solved my issue. There were two issues.

    First, I needed to be using the Transform of the TextMeshPro object in order to get the correct TransformPoint behavior. I'd thought that's what I was using but I guess gameObject.GetComponent<Transform>() was not giving me what I thought it was.

    Second, it appears characterInfo coords are using a reference frame where the origin is the bottom left corner. In order for the coords of my dynamically generated objects to make sense with the character coordinates, I had to set the anchor of my dynamically generated objects to be the lower left corner as well.
     
  27. JeffersonTD

    JeffersonTD

    Joined:
    Feb 5, 2013
    Posts:
    267
    Ite feels silly to ask a simple question like this, but how can I access the basic variables such as "Face - dilate" (available in the custom inspector for TextMeshProUGUI) via code?
     
  28. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Ok fixed this one, still waiting for the older shaders that might work with N3DS.
     
  29. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    When building, I get this error:
    All script that has an implementation of TextMeshPro gives an error. However, playing in the editor just works fine.
     
  30. M0rrigan

    M0rrigan

    Joined:
    May 29, 2015
    Posts:
    29
    @Stephan-B Yes, I need the shadow to be cast in the scene in 3D and on other objects. Is there any chance to get a working solution for my case?
     
  31. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I will be back from Iceland on Sunday night and will check with the Graphic Team on Monday. I know that it is technically possible but I need information from them as this appears to be some custom implementation internally in Unity to do this.
     
  32. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    What platform are you targeting which is giving these errors?

    What version of Unity are you using?

    Try creating a new Unity project. Once the new project is created, please log out of your Unity account. Close Unity. RE-open Unity and then log back in..Then get the release of TextMesh Pro from the Asset Store and see if you get the same errors. The reason for the log in / log out is to make sure the Asset Store provides you with the appropriate version of the package.
     
    jvt619 likes this.
  33. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    I'm using 5.6 with the latest version of textmesh pro.
     
  34. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    What platform are you targeting where you are observing those issues?

    Have you tried creating a new project to check to see if you get the same behavior in a new project? Please be sure to follow the steps I described in my previous post.
     
    jvt619 likes this.
  35. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    Thanks, it was now successfully built.
     
    Stephan_B likes this.
  36. M0rrigan

    M0rrigan

    Joined:
    May 29, 2015
    Posts:
    29
    @Stephan_B okay, I will wait.
    BTW, I'm running into another problem related to tags.
    I have a text with color vertex #FFFFFF00, which is white with zeroed Alpha.
    Inside the input box I put a tag with the color #FFFFFFFF (white) to the letter H.
    Code (CSharp):
    1. <color=#FFFFFFFF> H</color>ello
    However the tag is ignored. The option Override Tags is disabled. Is this the expected behaviour?
     
  37. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Stephan, I am still waiting for the older shaders that might work with N3DS,
     
  38. Epsilon2

    Epsilon2

    Joined:
    Apr 24, 2016
    Posts:
    7
    I've upgraded TextAssetPro to Unity's edition (new version) and noticed the bug.

    When I'm using < font > tag with the font using the same material, an Error occured:

    Code (CSharp):
    1. ArgumentException: An element with the same key already exists in the dictionary.
    2. System.Collections.Generic.Dictionary`2[System.Int32,UnityEngine.Material].Add (Int32 key, UnityEngine.Material value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Array.cs:1932)
    3. TMPro.MaterialReferenceManager.AddFontAssetInternal (TMPro.TMP_FontAsset fontAsset)
    4. TMPro.MaterialReferenceManager.AddFontAsset (TMPro.TMP_FontAsset fontAsset)
    5. TMPro.TMP_Text.ValidateHtmlTag (System.Int32[] chars, Int32 startIndex, System.Int32& endIndex)
    6. TMPro.TextMeshProUGUI.SetArraySizes (System.Int32[] chars)
    7. TMPro.TMP_Text.ParseInputText ()
    8. TMPro.TextMeshProUGUI.OnPreRenderCanvas ()
    9. TMPro.TextMeshProUGUI.Rebuild (CanvasUpdate update)
    10. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:149)
    11. UnityEngine.Canvas:SendWillRenderCanvases()
    12.  
    I remember there was the same bug in old (non-Unity) version, but I fixed it by myself with one ContainKey check. New unity version is built with dll, so I can't fix it anymore.

    What can I do to prevent this error?

    Thanks!
     
  39. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Take a look at Example 12 and 12a as they should provide good insight on how to implement what you want to have happen when a link, word or even character is clicked. Right now it tracks mouse over (ie. position intersecting or being near a character, word or link) but you could add the extra check for the click.
     
  40. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I strongly suggest continuing to use the version of TextMesh Pro with source code which will continue to be updated and available on the TextMesh Pro user forum.
     
  41. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This is a material property and as such can be accessed using the Material API in Unity.

    There are several posts on the TextMesh Pro user forum related to this. Here is one of them http://digitalnativestudios.com/forum/index.php?topic=400.msg2978#msg2978. Performing a quick search on the TMP user forum should reveal several additional posts with additional information.
     
  42. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Are you typing this in the Input Field?

    Do you have Rich Text enabled on the Input Field itself?
     
  43. Epsilon2

    Epsilon2

    Joined:
    Apr 24, 2016
    Posts:
    7
    Oh no! It means I have to reassign these 200+ textmesh objects again?? I lost 2 days to do this.

    Is it possible to replace TextMeshPro (Unity version) to original TextMeshPro without need to reassign all these GameObjects?

    Another question: does your latest version support Unity 5.6.0f1 ?
     
  44. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The latest release of TextMesh Pro available on the user forum is the same as the one on the Asset Store with the exception of including source code.

    As I have stated several times, the two versions are not compatible with each other due to the dll process changing GUIDs. Since you purchased TextMesh Pro in the past, I would not given up access to the source code version which as I have said I will continue to support an update until the integrated version becomes available in several months from now as this will essentially be a complete re-write to incorporate the functionality of TMP into Unity.
     
  45. Epsilon2

    Epsilon2

    Joined:
    Apr 24, 2016
    Posts:
    7
    Ok, Stephan. I've imported back your version of TMP and restored old object IDs from backup. And made some patches, so everything is ok now, except this error (which is NOT fixed yet). But now I have an ability to fix it in source code again.

    I will explain in case someone have the same issue. So the error message looks like this:

    Code (CSharp):
    1. ArgumentException: An element with the same key already exists in the dictionary.
    2. System.Collections.Generic.Dictionary`2[System.Int32,UnityEngine.Material].Add (Int32 key, UnityEngine.Material value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:596)
    3. TMPro.MaterialReferenceManager.AddFontAssetInternal (TMPro.TMP_FontAsset fontAsset) (at Assets/TextMesh Pro/Scripts/MaterialReferenceManager.cs:61)
    4. TMPro.MaterialReferenceManager.AddFontAsset (TMPro.TMP_FontAsset fontAsset) (at Assets/TextMesh Pro/Scripts/MaterialReferenceManager.cs:46)
    5. TMPro.TMP_Text.ValidateHtmlTag (System.Int32[] chars, Int32 startIndex, System.Int32& endIndex) (at Assets/TextMesh Pro/Scripts/TMP_Text.cs:6278)
    6. TMPro.TextMeshProUGUI.SetArraySizes (System.Int32[] chars) (at Assets/TextMesh Pro/Scripts/TMPro_UGUI_Private.cs:1012)
    7. TMPro.TMP_Text.ParseInputText () (at Assets/TextMesh Pro/Scripts/TMP_Text.cs:1704)
    8. TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Assets/TextMesh Pro/Scripts/TMPro_UGUI_Private.cs:1512)
    9. TMPro.TextMeshProUGUI.Rebuild (CanvasUpdate update) (at Assets/TextMesh Pro/Scripts/TextMeshProUGUI.cs:227)
    10. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:149)
    11. UnityEngine.UI.ScrollRect:LateUpdate()
    12.  
    Checking in MaterialReferenceManager.cs:61 I see the ContainKey check, however it's not enough.

    Code (CSharp):
    1.         private void AddFontAssetInternal(TMP_FontAsset fontAsset)
    2.         {
    3.             if (m_FontAssetReferenceLookup.ContainsKey(fontAsset.hashCode)) return;
    4.  
    5.             // Add reference to the font asset.
    6.             m_FontAssetReferenceLookup.Add(fontAsset.hashCode, fontAsset);
    7.  
    8.             // Add reference to the font material.
    9.             m_FontMaterialReferenceLookup.Add(fontAsset.materialHashCode, fontAsset.material);
    10.         }
    11.  
    The problem occurs when I am trying to use <font> tag in text which switching to other fontAsset with the SAME material.

    So I have added one line to your code so this piece become looks like this:

    Code (CSharp):
    1.         private void AddFontAssetInternal(TMP_FontAsset fontAsset)
    2.         {
    3.             if (m_FontAssetReferenceLookup.ContainsKey(fontAsset.hashCode)) return;
    4.  
    5.             // Add reference to the font asset.
    6.             m_FontAssetReferenceLookup.Add(fontAsset.hashCode, fontAsset);
    7.  
    8. // @Added by Epsilon. Fixed <font> tag adding another fontAsset with the SAME material
    9.             if (m_FontMaterialReferenceLookup.ContainsKey(fontAsset.materialHashCode)) return;
    10. // end of fix
    11.  
    12.             // Add reference to the font material.
    13.             m_FontMaterialReferenceLookup.Add(fontAsset.materialHashCode, fontAsset.material);
    14.         }
    15.  
    I hope you will integrate this in next version of TMP.

    Thanks again for your great asset!
     
  46. M0rrigan

    M0rrigan

    Joined:
    May 29, 2015
    Posts:
    29
    Yes, I was typing in the Input Field, BUT the Rich Text was disabled. I tried to enable RTL Editor, but I got two Input Field, and one is totally messed up. Take a look at the screenshot. Also, the tag doesn't work, and for some reason the only result I get is a backward text (you can see by yourself in the screenshot).
     

    Attached Files:

  47. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    About N3DS:
    I found an older release of TMP Nov16.
    I want to try if it works with the new N3DS but I got my text UN-aligned and I get this message each time I want to align the text.:

    enum index is out of range
    UnityEditor.SerializedProperty:set_enumValueIndex(Int32)
    TMPro.EditorUtilities.TMPro_uiEditorPanel:OnInspectorGUI() (at Assets/TextMesh Pro/Editor/TMPro_uiEditorPanel.cs:547)
    UnityEditor.DockArea:OnGUI()
     
  48. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Tried it in the N3DS but it doesnt work. Any ideas? I am stuck one week with this.
     
  49. Vortavasail

    Vortavasail

    Joined:
    Apr 22, 2016
    Posts:
    44
    Does anyone know about this error when I use a drop down I get this error?

    Assertion failed on expression: 'IsFinite(outDistanceForSort)'
     
  50. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Enabling Rich Text is located in the Extra Settings of the text object inspector.

    RTL stands for Right To Left text which is why it is reversed.

    In the Input Field inspector panel, there is a enable rich text option.
     
Thread Status:
Not open for further replies.