Search Unity

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. gamesbyangelina

    gamesbyangelina

    Joined:
    Jun 23, 2013
    Posts:
    20
    Hey folks! A few pages back someone mentioned having trouble upgrading from an older version of TMP. The solution was to completely remove the old version and import the new one, but doing this breaks all my existing text, and would generally be Pretty Bad.

    You mentioned a script that might iterate through the project and fix all broken references. Did you ever write that script? Alternatively, can anyone roughly suggest what needs to be replaced with what? I've never edited Unity prefabs before. I could write the editor script myself probably but I'm not sure exactly what changes are needed to fix a broken reference in an object.

    The current situation is kind of frustrating, so any help would be super appreciated. Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    As per the Important Note in the Asset Store, users of the paid / source code version of TextMesh Pro should continue to use the paid / source code version as these two versions (free / dll only and paid / source code) are not compatible with each other. Although it is possible to convert a project from one to the other, there are no benefits for a paid / source code version user to switch to the free version and go through this process.

    In terms of the upgrade process, this has never changed over the past 3 years where before importing the new release, you have to remove the previous version first. This is covered in the Release / Update notes. Removing the previous package is required because the Asset Importer is not an installer and as such can only override or add new files. It has no ability to deal with files that are no longer needed, renamed or moved.

    If you have purchased TextMesh Pro in the past, updates to the paid version continue to be available on the TextMesh Pro user forum as they have been over the past several years. I will continue to provide support for both version of TMP until some time after the new integrated version is released and the vast majority of users have migrated over to it.

    In order to get access to the TextMesh Pro user forum, you will need to register and provide your invoice number as part of this process. Once approved, you will find the latest releases in the "TMP - Alpha, Beta and Final Releases" section of the user forum.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    hmm...I've removed and reinstalled TMP and nothing broke for me. I would backup your project and give it a try. Now, it does appear to look "broken" at first once you reinstall, but if you hit play or close and reopen the project, all the existing text should return visually. But...Backup first just in case. Always important.
     
  4. jcuriel_glu

    jcuriel_glu

    Joined:
    May 26, 2017
    Posts:
    16
    I'm getting this error after importing TextMesh Pro from the Asset Store in a new project in Unity 5.4.5p5. I've tried removing the folder completely and re-importing from the Asset Store 3 times now and this error still pops up. Any suggestions? I assume I need TextMesh Pro for my version of Unity...where would I get that?

    TypeLoadException: Could not load type 'TMPro.TMP_InputField' from assembly 'TextMeshPro-1.0.55.2017.1.0b12, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    UnityEditor.CustomEditor..ctor (System.Type inspectedType, Boolean editorForChildClasses) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:30)
    System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:108)
    System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:151)
    System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoType.cs:595)
    UnityEditor.CustomEditorAttributes.Rebuild (System.Reflection.Assembly assembly) (at C:/buildslave/unity/build/Editor/Mono/CustomEditorAttributes.cs:70)
    UnityEditor.CustomEditorAttributes.FindCustomEditorTypeByType (System.Type type, Boolean multiEdit) (at C:/buildslave/unity/build/Editor/Mono/CustomEditorAttributes.cs:36)
    UnityEditor.CustomEditorAttributes.FindCustomEditorType (UnityEngine.Object o, Boolean multiEdit) (at C:/buildslave/unity/build/Editor/Mono/CustomEditorAttributes.cs:27)
    UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj, UnityEngine.Object[] subAssets, System.String assetPath) (at C:/buildslave/unity/build/Editor/Mono/AssetPreviewUpdater.cs:13)
     
    Last edited: Sep 29, 2017
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There is a bug with the Asset Store where it can end up providing the wrong version of an Asset for the version of Unity that you are using. In your case, it appears that you are getting the package for Unity 2017.1. You can easily tell by looking at the name of the DLL's in the "TextMesh Pro/Plugins/..." folder. The naming convention is as follows "TextMeshPro-1.0.55.2017.1.0b12 where 1.0.55 is the version number. 2017.1 the Unity version and .0b12 the beta version.

    To potentially get around the asset store bug, log out of your Unity ID. Open Unity 5.4 and then log in to your Unity ID and get the new package. When the import window shows up, take a look at the name of the DLLs and make sure they are something like "TextMeshPro-1.0.55.54.0bxx".

    If you still can't seem to get the correct dll, send me a PM / Conversation with your email address and the version of Unity that you are using and want the version of TextMesh Pro for.

    P.S. I will be out for a few hours later today (Hockey Game) but will be back and around all weekend so as soon as I see your reply or email, I'll get you taken care of.
     
    jcuriel_glu likes this.
  6. 39thstreet

    39thstreet

    Joined:
    Jan 30, 2012
    Posts:
    104
    I am trying to upgrade an older project. I followed all the instructions, deleted the Text Mesh Pro directoy and used the download from the digitalnativestudios site.

    My game now generates a ton of these errors on play:
    Code (CSharp):
    1. MissingComponentException: There is no 'RectTransform' attached to the "TitleText" game object, but a script is trying to access it.
    2. You probably need to add a RectTransform to the game object "TitleText". Or your script needs to check if the component is attached before using it.
    3. TMPro.TextMeshPro.LateUpdate () (at Assets/TextMesh Pro/Scripts/TMPro_Private.cs:1447)
    Any ideas why?
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See my reply on the TMP user forum.
     
  8. gamesbyangelina

    gamesbyangelina

    Joined:
    Jun 23, 2013
    Posts:
    20
    Thanks for the help folks. It's been a long time since I touched TMP - I'll take your advice and figure out whether to upgrade or sit tight. Thanks for being great, as usual.
     
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you check what version of TMP you are using? The version # is located in the header of the TextMeshPro.cs file.
     
  10. KrzysztofX10

    KrzysztofX10

    Joined:
    Aug 12, 2017
    Posts:
    9
    Hi,
    Yesterday I downloaded the latest version of TextMesh Pro to my project and I am having two problems with it.

    The first problem is that the font asset creator does not seem to detect kerning in an OTF font that I want to use. I downloaded an OTF font that originally did not have any kerning, and I added kerning by classes myself in Fontforge. I checked that kerning works perfectly fine in Microsoft Office Word, but in the font asset creator, even though I check the box to find kerning pairs, the generated font asset has 0 kerning pairs. What should I do about this?

    The other problem is, is it possible to condense or stretch text horizontally in TextMesh Pro? In Word you can do this by going to font (Ctrl+D) --> advanced --> scale, but I could not find a similar functionality in TextMesh Pro. I am talking about stretching/condensing the characters themselves and not changing the spacing between them.
     
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    TextMesh Pro does not currently support importing kerning data located in the GPOS table which is common with OTF / OpenType fonts. Support for OpenType features which includes kerning, contextual kerning, ligatures, etc. is planned for the new integrated version of TMP.

    TextMesh Pro does not currently support distorting / scaling the text horizontally and although this is not planned for the new version, it should be fairly simple to add. If I have time, I could possibly add this to the current version of TMP.

    Update
    While waiting for a new rebuild of the Unity source code (which can take 30 minutes or more), I decided to poke around the Condensed text feature suggestion.



    In this example, this is using a new tag <scale=x.xx> which right now only affects the horizontal scale. I would likely rename this tag to make it clearer that it is to simulate condensed text. This prototype of this new feature doesn't handle the SDF scaling requirement but when using +/- 15% it might be fine to leave the SDF Scale untouched.

    P.S. The was simple to add given TMP already includes the <rotate=x.xx> tag which uses a TRS matrix which is what this new feature also uses.
     
    Last edited: Sep 30, 2017
  12. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    2017.3b2 - Changing new Lightmap Encoding to High Quality throws errors and makes text pink.
    Going back to Normal Quality fixes the bug.
     
    Last edited: Dec 10, 2017
  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please make sure you submit a bug report with a repro and post the case # here.
     
    JakubSmaga likes this.
  14. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Hi,

    Started using TextMeshPro to replace the default Unity's TextMesh from my project.
    So far everything super smooth and working a charm, conversion was kinda easy.

    Unfortunately for the 2 following points working very well with the Unity's TextMesh and where TextMeshPro doesn't seem to be flexible.
    But would like to hear some feedback at least since I am a novice using it.


    ① Font assignment in run-time:
    I have an huge list of font the user can assign to the textmesh in runtime from a given library.

    ② Text Area :
    User is able to select the 3D Text clicking on it. (raycast + boxCollider does the job);
    • Unity's TextMesh : Mainly playing with the MeshRender.bounds.size which is efficient.
    • TextMeshPro : Setting up a width and height of 10 by default with Wraping & Overflow Disabled to allow the user to full text area. The issue is I am not sure how to access to the text size... since the width and height always remains to 10... Any MeshRender thing I could at least access to the text vertices then I can generate my own BoundingBox data? or maybe is that available?


    So far, it is awesome, a lot of fun on my side! :)
    Thank you!
     
    Last edited: Oct 6, 2017
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You have to create a Font Asset for each of the source font file you wish to use. Although this require works ahead of time, (1) it ensures best performance at runtime since everything is pre-generated as compared to the Dynamic system which can result in significant performance overhead.

    (2) It also allows you to control the size of these assets as you may only need a sub set of the characters contained in the font file allows you to exclude a potentially large source font file from the build.

    (3) It also provides for better control of quality since you can control sampling point size and other factors that affect quality / rendering and also create / use material presets to define visual styles for each of the font assets.

    (4) It also allows you to define fallbacks to split the character through multiple font assets also making it possible to use a different font as a fallback in the event the source font file is missing certain glyphs or in case the includes glyph don't look as good (from a style point of view) for certain languages. This is common with CJK where the latin character look fine but CJK not so good.

    The new integrated version that I am working on (no ETA) will support Dynamic Fallback so it will provide the best of both worlds in terms of flexibility and quality and performance.

    But it is more work ahead of time.

    Not sure I understand here. The size of the bounds of the mesh are as they should be. The bounds of the Text can be different but both properties are accessible. In the example scripts provided with TMP, the is a script called "TMP_TextInfoDebugTool.cs" which allows you to see the content of the TextInfo as well as the bound of the mesh and text. Add that script to any text object to see this information.
     
  16. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Thanks for your fast answer!

    ① Yeah its gonna be a pain on my side to generate every fonts manually :(...
    But well....
    Would have been good to have a straight "256x256 TMP_FontAsset maker" tool from a huge fronts selection... :D :D


    ② TMP_TextInfoDebugTool.cs : just had a look and it seems to be all what I need...

    Thank You ! :)
     
  17. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    Stephan's response time is nothing short of amazing!
     
    sama-van likes this.
  18. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    This seems really good!
    Want to try this, so I have three questions.

    1. Is this the official asset from Unity?

    2. Is it possible to check if a user touched a certain character from a Text Mesh, just like normal independent GameObjects?

    3. Is there an option like UI Text's "Best Fit" for adjusting size automatically to fit the text to the text rectangle area?
     
    Last edited: Oct 7, 2017
  19. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Yes. Unity acquired TextMesh Pro back in March.

    Yes and no. The elements of the text object (characters, words, lines, etc.) are all part of a single object. However, if you take a look at example 12 and 12a included with the product, you will see that interactions with these individual elements can be detected. When looking at example 12, hold the right-shift to interact with characters.

    Yes. However, text Auto sizing like Best Fit requires multiple passes to determine the best size. This should be used to determine the optimum size of typically the largest text object and then disable this feature and manually set the size of all text objects to that size. Having several text objects using different point size is considered bad UI design and typography. So like I said use Auto sizing to find the right size and turn it off and apply it on the other objects.
     
    UnityIsTheBest likes this.
  20. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    I see, thanks a lot Stephen!
    As for auto sizing, you're right, normally it isn't really good UI design. But I need that in some features of my app.
    Say, my app has a fixed text area without any scroll bars and users will type their custom texts in there.
    I don't know how long the text would be nor what their language would be so Best Fit is a real lifesavor for me in this particular case :)

    This is a literally awesome tool, but too many posts and videos to look at.
    I think I'll need some time to get used to this..
    Could I ask a few more questions?

    1. Is it possible to capture or get pixels of the resulting text so that I can project or draw it to the other object's surface?

    2. Is there any chance that TextMesh Pro will be integrated with Unity Editor in the near future just like Test Runner which was a part of Unity Test Tools asset?
     
    Last edited: Oct 8, 2017
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You can setup a render texture and then use the resulting texture on whatever object.

    I am currently working on a full re-write of TextMesh Pro which will be fully integrated into Unity.

    Until this new implementation / tool is ready and to make it easier for users to discover and get access to the features and functionality of TMP, we are exploring ways to distribute TMP with Unity.
     
    MusaabOsman, UnityIsTheBest and MV10 like this.
  22. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Hi Stephan B.,

    I am getting 2 compiler errors when trying to make a standalone build.

    [Error] Shader error in 'TextMeshPro/Sprite': variable 'OUT' used without having been completely initialized at line 84 (on d3d11)

    [Error] Shader error in 'TextMeshPro/Mobile/Bitmap': 'vert': identifier represents a function, not a variable at line 85 (on d3d11)

    I just started using Text Mesh Pro today for the first time. I pulled the package from the Asset Store. I am using Unity 2017.1.0f3, and the package dll is TextMeshPro-1.0.55.2017.1.0b12

    I tried deleting the shaders folder and re-importing it, but that didn't work.

    Any help would be appreciated.
    Les
     
  23. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I have seen that type of error once and it was related to some other add-on.

    My suggestion (for testing) is for you to create a new empty project. Then import TextMesh Pro into it to see if you still get the same error.

    Assuming you don't get the error in a new project, then import the other add-ons from your normal project one by one to see which one causes the issue.
     
  24. Robdon

    Robdon

    Joined:
    Jan 10, 2014
    Posts:
    141
    Hi,

    Having some problems with TextMeshPro and the 'bold' setting.

    If I bold the text, with the 'B' option in the 'Font Style' section, then it seems to be also increasing the char spacing, and there for the total width of the text.

    This doesn't happen with the old UI text control.

    I've worked out that is changes the char spacing by 2.794 for bold text.

    Since 2.794 seems very specific, is that being calculated in some way? Or can I always presume the char spacing will be modified by 2.794 every time I bold some text.

    Or, if there is some way of stopping it changing the char spacing when I bold text, like the old control?

    I'm trying to keep some text the same size but 'bolded' when you mouse over something, so that is the use-case.

    Thanks, Rob.
     
  25. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    Thanks for your quick kind replies and the efforts on TMP!
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Depending on the source font file, bold or any other font weight can have different advance value for individual characters.This all depends on whoever designed the font family and weights.

    When using true bold / font weight where you would assign the bold typeface in the Font Asset, the advance is set in the source font file.

    When using simulated bold, you can control the advance / spacing that will be added in the font asset inspector. See image below

    upload_2017-10-9_11-47-4.png
     
    Robdon likes this.
  27. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    Oh..,
    I just found one thing 3D Text(or UI Text) is better over TMP.
    With 3D Text, I can ignore the Font settings when I'm just okay with system's default fonts.
    This is useful, because when the text is mixed with different countries' characters, running platform's default fonts are chosen automatically for each one.
    It doesn't have to be the same way, but I want to put a text board which can show English, Chinese, Japanese and Korean letters at the same time.

    How can I achieve this?
     
  28. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In order to combine characters from multiple font assets and fallback as well as from different fonts, you can use the fallback system in TMP. See the following video which although needs updating since I added more functionality to the fallback system will still provide a good overview of what is possible.

    Please note that you can assign multiple fallback per font asset as well as general fallbacks in the TMP Settings file. Fallback font asset can also have their own fallback and you can even fallback to sprite assets assuming you have assigned unicode values to the sprites.

    When creating fallback font assets, make sure that you maintain the same ratio of Sampling Point Size to Padding in order for material properties from Material Presets to look the same visually as you switch from font to font / fallback to fallback. By maintaining this ratio I mean, if the primary font asset is using 100 sampling point size with 10 padding, the fallback could use 50 point size with padding of 5 which resulting in the same ratio. This provide great control over having a primary designed for best visual appearance while having lower quality / sampling settings on the fallback to minimize package size.

    There are several posts also covering this topic here on the Unity forum and on the TMP user forum.
     
  29. timselberg

    timselberg

    Joined:
    Mar 31, 2014
    Posts:
    2
    Hi,

    I have started using the networking solution GameSparks for my project but ran into some problems when using the input fields from TextMesh Pro. It's the registration and authorization that don't work for me in combination with the strings generated from TMPro. I talked to them about it and they suggested that you maybe are encoding the strings somehow. When I replaced all textmeshpro input fields with regular ones everything worked great. Since I want crisp text I tried to figure out why but no cigar. Thought that maybe textmeshpro add some extra stuff to the string values or something like that. In NoSQL, which stores the registered user I can see my Username as I wrote it. The password on the other hand is encrypted and don't know what is saved. When I Debug the field value in Unity, it also looks as I wrote it. Any clues?

    Thanks, Tim
     
  30. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There is nothing special that TMP does to string values returned from the input field. What specific issue / behavior are you seeing?
     
  31. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    I see..
    Playing around with this tool for a while, this is the best and what I've been searching for except for two things.
    Needing a little more effort for font asset creation,
    increasing file size even when just simple default fonts are needed. (this is critical in global mobile apps)
    I know nothing about behind the scenes of this and I know you are busy working hard, but if you can solve these problems in the future,
    then TMP will be perfect in every aspect and no need for UI Text or 3D Text anymore.

    This is not a directly related question to TMP, but I need your advice or opinion.
    I need a feature to show any country's string using system's default fonts like a simple text viewer app.
    So far I could do this with UI Text without any problem, but now I want to do the same thing using TMP's rich features.
    So I need all the fonts from all over the world in advance.

    Any idea where I can get the list of FREE simple global fonts similar to Android system's default ones?
    I mentioned Android specifically, because their fonts seem better than Windows' in my personal opinion.
    For example, many Koreans hated Windows' default 'Gulim' font, but liked Android's default one because it's prettier and more readable to them on the mobile screens.
     
    Last edited: Oct 11, 2017
  32. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In order to achieve the best results in terms of visual quality and performance, investing the time up front to create your font assets based on the specific needs of your projects will always be optimum.

    For instance, assuming your project is targeting several languages including CJK, your primary font assets (broken up by language or groups of languages) should only include the actual characters used in your project. Once you have created your font assets and required fallbacks, the source font file is no longer needed and given some of those font files can be upwards to 30MB, including a source font file when you are only using a small subset of the characters they include can be very wasteful in terms of resources. This gets a bit more complex when trying to handle user input but can still be managed nicely and will get easier with the dynamic fallback system I am planning on introducing in the future.

    Furthermore, having pre-created font assets allows you to design your material presets ahead of time to ensure you get the visual results and quality you expect.

    In terms of source font files, https://fonts.google.com/ is a good source of fonts where most of them have open / free licenses. Be sure to review the license for each of the fonts to be certain.

    Although you can find fonts that include most languages like NotoSans.ttc, often the design of the Latin glyphs compared to CJK or vice-versa might not appeal equally to users. This is where the ability to use the Fallback system in TextMesh Pro is pretty powerful as it allows you to select different source font files for different languages. Most of the time, TMP users will pick a font for the Latin based languages and then select a different font for CJK which is typically deployed using Asset Bundles to keep the install of the base game / project smaller and based on user language selection, the additional / required languages are then downloaded. Most of the time, users will include the characters needed to display language selections in their Latin base Font Asset or in a small fallback. Conversely, they also include a few Latin characters in their CJK font assets or fallback just to display Latin language selection.
     
  33. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    Don't get me wrong, I wasn't saying the system of Font Asset was bad or annoying.
    I'm watching your youtube videos and understood the reason why you made that way and really liked the idea.
    I was just saying as a user coming from Unity3D's UI Text, I felt if there was another option or default set-up for some cases like simple chat windows with normal fonts, it would be awesome.
    Unity3D was and still is a game engine, but compare to Unreal, it has a lot more potentials and many developers including me started to utilize Unity as an app development tool. That means TextMesh Pro also can be used in many different areas.
    Imagine VR education apps or fancy VR web browsers with many texts in various languages.
    Of course Text UI can be used but it can't do TMP's awesome things such as texturing, effects, animations and many more.
    What I wanted to let you know was TMP could be also used in normal long texts aside from cool Title texts and Game UIs. (If you look at the mobile apps, most of them just uses running system's default fonts and they are determined automatically)
    When I first saw TMP, I was shocked and now I admire you, I mean it. So I thought sharing my thoughts with you would help you in some ways in the future, because I believed you could do something great with new creative ideas.
    I really appreciate your efforts and fell in love with TMP!
    Have a good one.
     
    Last edited: Oct 11, 2017
  34. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    167
    Thank you Stephen for that information. I did that test and found that it was the Nvidia VRWorks plugin that was conflicting. I appreciate the direction.
     
  35. timselberg

    timselberg

    Joined:
    Mar 31, 2014
    Posts:
    2
    Just tried again to be sure, still not working. The login works fine if I use Unity's regular ui text. When I try to use the TextMeshProUGUI component it won't work. When I debug the input to unity's log it looks identical to what I typed and what the regular component prints but I still can't log in. In the case of login I get the response:
    Error Authenticating Player...
    {"DETAILS":"UNRECOGNISED"}

    Instead of the response that the regular component provides:
    Player Authenticated...
    UserName: Timpan

    "Timpan" is the username received through GameSparks API. Is any of the TMP settings interfering with the raw string such as "Rich text", "Overflow" or something else?

    Thanks / Tim
     
  36. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Any chance you provide me with a simple repro of this?

    You can provide me with the Repro via a private link sent to me via private message or just file a bug report with Unity and give me the case #.
     
  37. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    I have an odd situation when trying to show a degree symbol. I have added this into the font and it shows fine on my machine. But when I do a build and put onto another machine (desktop Windows) the degree does not show. I have tried on 2 different fonts and get the same behaviour. On my PC, another odd thing is the degree symbol also shows even if I don't have it in the font!
     
  38. Lecht

    Lecht

    Joined:
    Jul 1, 2014
    Posts:
    24
    Any chance to be able to control gradients through a tag? I'd donate for this feature. I read that you mentioned it would be clunky as far as practicality goes. But with the style tag I could see it being very useful.

    Thanks for your time.
     
  39. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Once the font asset is created and it includes this degree symbol, you should get consistent results related to individual glyphs on all machines. If these machines had low / old graphic cards, you could experience rendering issues but those would affect all characters not just one in particular.

    In order to investigate this, I would need a simple repro scene / package created with the export function that includes the scene / font asset and any script used in the repro.
     
  40. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What is your use case? Are you looking to apply a gradient to certain characters or words or blocks of text?
     
  41. Lecht

    Lecht

    Joined:
    Jul 1, 2014
    Posts:
    24
    Words and blocks of text. I have about 10 lines of text that need to be displayed. For instance:

    Damage: damage_value

    "Damage:" and "damage_value" both share the same bottom-left and bottom-right gradient colors, it's just the top-left and top-right that need to be different. For now I have to use 2 sets of TMP elements for each line, instead of just needing 1 and the lines are dynamic from context to context.

    So for instance one item in my game may be a piece of armor and the other may be a weapon. Well I have to set certain TMP elements to be inactive for each item and then re-enable them for others. This results in a ton of garbage collection and terrible performance.

    So 20+ elements being enabled/disabled constantly versus one block that is dynamically generated.
     
  42. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I think this would be a nice feature and do not see any technical issues with adding a rich text tag that allows to either define a color gradient (4 colors) or access Color Gradient Presets. This tag would override the vertex color or gradient preset assigned to the text object. In time, I could add the ability to control if it is affected by the vertex color for tinting.

    As you know I am working on the re-write of TMP / new text system for Unity so I don't have a lot of time to add new features to TMP. However, if I find some time, I'll definitely looking into this :)
     
  43. Lecht

    Lecht

    Joined:
    Jul 1, 2014
    Posts:
    24
    I completely understand having a full plate. Thank you very much for your time and consideration.
     
    Stephan_B likes this.
  44. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    Hi - I have now sorted this out. But it does point to an issue you might want to look at.
    1) I am importing text from a file during runtime. In the text is a symbol ° . Running the game in the editor everything looked good - so I assumed having the actual symbol worked..
    2) In the build the symbol did not work. So I put in the escape code into the text file. However, an extra backslash was being added. So in the end I did this: iS = iS.Replace("°", "\u00B0"); (so my text file is readable to humans)

    I have gone down a number of blind alleys (different fonts etc., adding the symbol to the font etc). The main reason is that the behaviour running the game in the editor is not matching the build. Maybe this has been sorted in more recent versions - if not - perhaps something for your list!
     
  45. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Public fields in the Unity Editor that contain Escape Characters like "\u" will be double escaped. This is a Unity convention which can be very confusing and not related to TextMesh Pro.

    The same behavior can also be observed when reading / importing text from some external source like XML, etc.

    This double escape "\\" results in the string being process as literal and thus would display as \u00B0 instead of the symbol.
     
    Last edited: Oct 20, 2017
  46. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Have been using TMP for a while now. awesome tool. But having some specific problems this last week. have been getting random speckling, sparking animating pixels in the DistanceField fonts during rendering. Happens on both mobile and non mobile versions. Basic font doesn't have the problem, but if we add glows, drop shadows, borders and the problem manifests. usually not on first launch of a build but sometimes/intermittent. and so far it is specific to Android S4... but not S3 or S5. (confirmed with more than one of each device tested) problem not present on iOS.
    using unity pro 5.6.3p3 with TMP 1.0.54 Dec 2016 ,GLES2, Gamma rendering space. Has anyone experienced random noise pixels in distance field fonts on mobile ? or know of a fix please ? help appreciated, thanks
     
  47. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you are able to reliably reproduce this behavior on those devices, I would strongly suggest you submit a bug report as this is likely a Unity graphic / shader related issue specific to that Android device.
     
  48. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Yep, we can't get rid of it. We make some changes.. seems like its fixed, then it comes back again after a launch or two. (on S4 device only) not sure if we can send the whole project, might take some time to make a stripped small project to send. Thanks for reply. Looking for a quick fix before shipping though.... so might have to try some other things.
     
  49. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You are using Unity 5.6 with an older version of TMP. Unity did add the "Additional Shader Channels" which was not supported by the older version of TMP but the impact if this would affect all devices not just this S4.

    My suggestion, is to download the latest version of TMP for Unity 5.6 which is available on the TMP user forum and test in an empty project on that device to see if you can observe the same behavior. Then in the event the issue was related to this "Additional Shader Channels" then figure out if you want to upgrade.
     
  50. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Thanks again. We "might" have found a temp fix, but otherwise was about to try updating as you suggested. Looks like that is newer than asset store version. Thanks.
    Temp fix is to put a white texture into the texture channel, Will update here again if the fix doesn't hold....
     
Thread Status:
Not open for further replies.