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

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Aye, saw that. Having the option to also offset horizontally (xoffset) or both (offset) would be neat! It doesn't sound useful at first, but it could be utilized for certain dialog effects like rumbling text on loud exclamations.

    Also, is there a way to reference tags via script to change their values without having to re-parse the whole content?
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The <pos> tag allows the text enclosed in the text to be move horizontally.

    The rich text tags are part of the text so to move or change them, you do have to modify the input text.

    Having said that, there is a <style> tag which allows you to define marcos of tags in a way. See the following video about the Style tag.

    Although I have not played with this myself, some of my more creative users have been modifying the style definition at run time which I guess would make it possible to alter what happens when those <styles> are encountered thus still requiring a regeneration of the text (to update the geometry) but would not require any string operations at all.
     
  3. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    We are experiencing some odd corruption around the cursor in the TextMeshPro Input field on a few build targets. OSX and Windows appear fine:


    On WebGL and IOS though we get some odd image artifacts around the input cursor.

    Cursor flash 'on':

    Flash 'off':


    Has anyone hit this one before?
     
  4. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This issue is due to inconsistent handling of certain characters in Unity between Mono and IL2CPP. The following post on the TMP user forum contains a temporary fix.

    I have addressed this behavior on my end and this will work correctly in the next released.

    P.S. Be sure to check / search the TMP user forum as you are most likely to find solutions to potential issues there.
     
    slumtrimpet likes this.
  5. slumtrimpet

    slumtrimpet

    Joined:
    Mar 18, 2014
    Posts:
    372
    Thanks man, fix seems to work. Also, just posted a question on a different front on your forum and I'll initiate conversations like this there in the future.
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Stephan, awesome plugin, I'm really looking for something that has strong Arabic support. I've done some tests and most things work well, but effects such as outline do not. It is doing the effect per character instead of to the final joined text, eg:
    upload_2016-9-28_16-16-21.png

    This also means transparent text or fading text has these joining/overlapping artifacts visible.
    I was wondering is there something I've missed that we need to enable to fix this? Or do you have any idea if/when this issue will be addressed?
    Thanks,
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Here's an image showing the overlapping that is visible when you set the alpha to 0.5:

    upload_2016-9-29_11-14-0.png

    I was wondering if perhaps this overlapping and outline issue could be fixed by using the stencil buffer in the shader? For example the text could write "140" to the stencil buffer, and then it could have a test so that is won't write any pixel if stencil buffer value == 140..

    Another issue we found is that certain diacritic characters are not rendered in the correct position:

    upload_2016-9-29_11-16-45.png

    It seems that some of those diacritic marks should be rendered centrally on the character that they're associated with, instead of to the left of them. There are some rules for this. We had to make these corrections for uGUI as well. I would be happy to share this code with you if you are interested.

    Thanks,
     
  8. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Looks like I missed this post (here) but thank you for posting it on the TMP user forum. To anyone interested, see my reply here.
     
  9. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Just learned that TextMesh Pro has been selected as a finalist for the Unity Awards for 2016 in the Asset Store category.

    I am honored TextMesh Pro has been selected and most grateful for all my users who made this possible. Once again, thank you all so much for your amazing support :)
     
    magique and ikazrima like this.
  10. stevenatunity

    stevenatunity

    Joined:
    Apr 17, 2015
    Posts:
    114
    That should take nobody by surprise ;) @Stephan-B glad you are getting the credit you deserve! TextMesh Pro should be the worthy winner of the award :cool:
     
    Stephan-B likes this.
  11. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    In conjunction with the addition of the ability to use Animated Sprites in the next release of TMP, I added the ability to reorder the sprites in the Sprite Asset.



    This way regardless of where in the sprite texture atlas the actual sprites are located, you will be able to reorder the sequence for the sprites to animate correctly.
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Link Text Overflow Mode
    I am working on a new text overflow mode which makes it possible to link several text objects together to allow text to flow from one object to another. This will make it easy to create text columns and more sophisticated layouts.

    This new feature works with existing rich text tags including the Multi Font & Sprites and Style tag.

    Here is a quick example showing this new overflow mode.



    Link to GIF http://imgur.com/6skGN0c
     
    Last edited: Oct 14, 2016
    electroflame likes this.
  13. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    That's amazing. I mean, TMP was already amazing, but tackling some of the text-based UI issues as well? Thumbs up!
     
    Stephan-B likes this.
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a simpler example of the Text Overflow - Linked mode. I guess the previous GIF was too big in size for the forum.

     
    tachyon-particle likes this.
  15. sama-van

    sama-van

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

    I would like to buy the plugin but I have a few questions about the shape which the text can be bent.


    Below a picture with 4 shapes (A, B, C, D).

    TextMeshPro.png

    Checking the documentation or other videos, it seems the A one is possible.

    But please could you let me know which are really possible or not?

    Thank you! :)
     
  16. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Since the geometry of the text object is accessible via the TextMeshPro.textInfo.meshInfo[] this makes it possible to modify the vertex position to achieve these types of results.

    Example A is fairly simple since it can be done by simply rotating each character (all 4 vertices) based on some curve. The other examples are trickier since there are deformations (skewing, etc) where the vertices need to be individually manipulated. In the end it is a more complex process but still achievable.

    For some more complex manipulations, the geometry of the individual characters might need to be tessellated which depending on your experience can be much harder to do.

    Please also note that some packages like Mega-Fiers which work with TextMesh Pro also make this possible. See the following post http://digitalnativestudios.com/forum/index.php?topic=882.0
     
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Working on adding support for Vertical Scrollbar to the TMP Input Field.

     
  18. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    I know Text Mesh pro supports SDF but is it single channel or multi channel?
    upload_2016-10-25_10-20-10.png

    upload_2016-10-25_10-20-23.png
     

    Attached Files:

  19. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It is single channel SDF as there are no real clear benefits yet to using multi channel as you are trading off sharper corners at lower sampling point size for a larger texture atlas and increase shader performance overhead whereas you can increase the sampling point size of the single channel SDF where you end up with about the same result but without the more complex process and shader performance overhead.

    See the following post where I provide some examples.

    Of course I will continue to explore these types of alternative sampling methods for the SDF and should one of them provide clear benefits, I will certainly contemplate adding support for it.
     
  20. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    Last edited: Oct 25, 2016
  21. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    As per the Frames per Second chart, the frame rate is slower with Multi Channel. The processing of the SDF is more complex and the texture size (RGBA vs. 8 Bit Alpha) is 4x larger.

    Basically, if you increase the sampling point size of the single channel SDF by the same proportion you essentially get the sharper corners without the extra complexity and performance impact.

    Like I said, I am keeping an eye out on these alternative SDF sampling / rendering methods.
     
    Hodgson_SDAS likes this.
  22. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Vertical Scrollbar
    As per my previous post, I added the ability to use a Vertical Scrollbar with the TMP Input Field. This new feature will be available in the next release which will be shortly after Unite in Los Angeles next week.

    Here is an updated video showing the new functionality and screen shot of the new Inspector Panel / Options.



     
    MV10 and zyzyx like this.
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    PREVIEW - Linked Text Objects
    Another feature that I have been working on for the next release of TextMesh Pro is a new Text Overflow mode which makes it possible to link several text objects together where the text that exceeds one text container will flow to the next text object in the link.

    As you can see in the example blow, as I resize the first text object, the text automatically re-flows through the linked text objects.



    Since there appears to be an issue on the Unity Forum with GIFs, here is a still image and link to the animated GIF in case you are unable to see the one above.

     
    Last edited: Oct 29, 2016
  24. rumaniel

    rumaniel

    Joined:
    Jun 3, 2015
    Posts:
    5
    Hello,

    I'm planning to use TMP with ugui. But I want to use custom sorting layers and orders. So I thinks I can use normal TMP component. but I concern about performance. It's just 2d game with orthographic projection for mobile. I wish it is useless concerned. Thanks
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    With UGUI, you should be using the TextMeshProUGUI component designed to work with the new ui system / canvas. This component is located in the Create - UI - TextMeshPro - Text menu.

    You can also use the normal TextMesh Pro component which is designed to work with the mesh renderer which offer before performance then the canvas renderer. But if you want to use the canvas system, you have to use the TMP component designed for it.

    In terms of overall performance, TextMesh Pro either matches or offer better performance than Unity's text components.

    Let me know if you have any other questions or need more information on any of this.
     
  26. 0xC0DED00D

    0xC0DED00D

    Joined:
    Feb 26, 2016
    Posts:
    3
    We just started using TextMeshPro, and we are running some problems with our source control solution. When we play in the editor a scene that has prefabs with TextMeshPro components, Unity thinks they have changed, and then when saving work or leaving the scene, it calls OnWillSaveAssets is called in our UnityEditor.AssetModificationProcessor. The diffs of the prefab file is the same, but because something has changed in the prefab (that seems like it is reset when preview mode is exited), it still thinks the file needs to be saved.

    We ran into a similar problem where we modified sharedMaterial, and then the material files would constantly need to be saved even with no changes.

    This is an issue because we consider prefab files to be exclusively locked since merging them is very hard.

    Does anyone know what is being changed that is triggering Unity to think the prefab has been modified? Is there any workaround?

    I can come up with an example scene if needed, but it wouldn't be good to share publicly with the TextMeshPro source code.
     
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I have actually and finally managed to track down the source of this behavior and believe I have a solution for it.

    Just to make sure of it, could you email me or post on the TextMesh Pro user forum (where shared files are private) your repro scene so I could verify this and confirm? If you share the scene via email / link please make sure this is private.
     
    Hodgson_SDAS likes this.
  28. 0xC0DED00D

    0xC0DED00D

    Joined:
    Feb 26, 2016
    Posts:
    3
    Shared via Google Drive to your support email address. I'd be interested to hear what the issue was. It seems like something is being modified in editor because just loading the scene (and not doing Play in Editor) is actually enough to cause the problem.

    Thank you for your quick response!
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you for the project repro. I'll look at it tonight and provide feedback shortly thereafter as I am still in LA as I was attending Unite.

    In terms of the source of the issue here is why this is happening.

    In order to make sure material properties and values don't result in "blowing up" the material as users adjust these values in the editor, ratios are computed and set on the materials. As a result of this and potential use of bold text which affects these ratios, these end up changing which is why Unity detects they have changed although as a user you did not change the material directly but still happened behind the scene.

    Once I discovered this behavior, I reworked how these ratios are handled to prevent this. This was one of those bugs which was so obvious to fix once I realized what was causing it.
     
    Hodgson_SDAS likes this.
  30. ttermeer

    ttermeer

    Joined:
    Feb 3, 2016
    Posts:
    10
    With Unity 5.4.2, there seems to be a breaking bug where color set on TextMeshProUGUI that are inside a prefab gets reset to their original prefab value when open the scene again.

    The color value saved in the scene by Unity are correct. However they are not being used when the scene is loaded.
    This behavior is only seen with TMP in 5.4.2. It does not happen with Unity 5.4.1
     
    Last edited: Nov 8, 2016
  31. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you provide the steps or email me a simple repro project that would enable me to reproduce this behavior?

    Have you tested in Unity 5.4.2p3?
     
  32. ttermeer

    ttermeer

    Joined:
    Feb 3, 2016
    Posts:
    10
    Just updated to 5.4.2p3 and tried on a blank project same issue.
    Sent you an email with the project and step to reproduce.
     
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you. I'll take a look later this afternoon and provide feedback as soon as I have something for you.
     
  34. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This image may not look like much...



    Until you pay close attention to what characters are being requested.

    Here is an image of the Sprite Asset Editor which now includes a new field "Unicode" value for each sprites.



    Basically, TextMesh Pro will now be able to use a Sprite Asset as a fallback. So when the requested character is not found in the primary font asset or any of the assigned fallbacks, TMP will now look into the Default Sprite Asset for a sprite with the corresponding Unicode value.
     
    MV10 likes this.
  35. popMark

    popMark

    Joined:
    Apr 14, 2013
    Posts:
    114
    Having lots of compiler errors with the latest version of TMP in Unity 5.1.2f1 :(
    Any chance of downloading am earlier working version?

    [EDIT] Got a version from the TMP forum cheers
     
  36. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
    5.3.6 - works nice
     
  37. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Hi, just bought the package because Typogenic by Thomas Hourdel ran out.
    I have HDR enabled in my scene, need my text to glow and so added this line

    [ColorUsageAttribute(false,true,0.0f,3.0f,0.0f,3.0f)]

    above

    _FaceColor ("Face Color", Color) = (1,1,1,1)

    in Shader "TextMeshPro/Distance Field".

    Unfortunately the colorpicker does not change to hdr - any help welcomed, thank you!
     
    Last edited: Nov 21, 2016
  38. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Is a TextMeshPro string different to a normal string in some way? I ask this because when I pass in "a normal string" to a function 'manually' it works fine, but when I get the .text component value from a TextMeshProUGUI component and pass this into the same function, it doesn't work. (in my case retrieving a username from a database.) When I print the strings they are identical in every way. Any idea?
     
  39. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    959
    @Cascho01, the ColorUsage attribute works for component fields only, not material properties. You'll have to adjust the shader GUI code to explicitly use an HDR color field.

    Assuming you're using the SDF shader, you have to tweak the DoFacePanel method inside TMP_SDFShaderGUI.cs. Comment out the DoColor invocation and replace it with something like the following.

    Code (CSharp):
    1. //            DoColor("_FaceColor", "Color");
    2.             MaterialProperty color = FindProperty("_FaceColor", properties);
    3.             color.colorValue = EditorGUILayout.ColorField(
    4.                 new GUIContent("HDR Color"), color.colorValue,
    5.                 true, false, true, new ColorPickerHDRConfig(0f, 3f, 0f, 3f)
    6.             );
    That's not pretty, but it gets the job done. To prevent losing this change when updating TextMesh Pro, duplicate the shader GUI class and rename it, then change the duplicate. Then you only have to adjust which GUI the shader file references.
     
  40. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you provide an example of the behavior you are running into? Perhaps an example of the string or code you are using?

    BTW: Often when a string comes from some external source like a Database for instance, escape characters contained in the string are converted to string literals. So for instance, a "\n" becomes "\\n" which instead of being converted to char(10) or a linefeed, ends up being "\" + "n". When you say the strings are the same, try iterating over each char in the string to retrieve the value of the individual chars to check.
     
  41. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Thanks very much, I hope Stephan-B will include this in the next update?
     
  42. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Next issue:
    Adding a TextMeshPro-Component to an empty GameObject changes the Transform to a RectTransform - why?
     
  43. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are two reasons for this. The first is due to the TextMesh Pro objects inheriting from a common class TMP_Text which given C# doesn't support multiple inheritance, this class needs to inherit from MaskableGraphic which ends up forcing the use of a RectTransform on these objects.

    The second reason which makes the first one (ok / fine) is the text needs to live in some defined area / text container which is what the RectTransform provides.
     
  44. Matthias1231

    Matthias1231

    Joined:
    Aug 20, 2012
    Posts:
    62
    I ran into what appears to be a bug. Here is a duplicated sequence using the drop caps workaround I found earlier in this thread.
    On the attached image you can see that the </indent> in the second paragraph is being ignored. That is until you add a space after the </indent> tag in the first paragraph.

    Not a big deal but I thought I'd report it.

    <line-height=1em><voffset=-2.5em><size=4.2em>B</size></voffset><indent=9.7em>hsdalfh asjdfh asjdfh lasjfh lasjfh lasjfhwerwleh </indent>fdsafh asldfh lwejrh lqwejrh lqwjerhl qwjerhlqwkj

    <line-height=1em><voffset=-2.5em><size=4.2em>B</size></voffset><indent=9.7em>hsdalfh asjdfh asjdfh lasjfh lasjfh lasjfhwerwleh </indent>fdsafh asldfh lwejrh lqwejrh lqwjerhl qwjerhlqwkj
     

    Attached Files:

  45. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you register on the TextMesh Pro user forum and re-post this information there? It makes it a lot easier to track individual reports and for us to discuss those while also making it easier for other users to find such information.

    P.S. I'll try to take a look at this later tonight.

    P.S.S. At some point I also need to add real support for DropCap.
     
  46. Matthias1231

    Matthias1231

    Joined:
    Aug 20, 2012
    Posts:
    62
    Sure thing!
    Real support for drop caps would be awesome.
     
  47. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It would indeed :)

    I just need to find the time to work on it. So much to do and so little time...
     
  48. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    How can I enable backface cull on Text Mesh Pro?
     
  49. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
  50. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
Thread Status:
Not open for further replies.