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

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Stephan B ,

    Would it be possible to put two TextMeshPro fonts in the same text? With inline? Or are they strictly separate?
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Only 1 font per text object at this time but the ability to combine multiple fonts & material per text object is one of the new features I'll be adding soon to TextMesh Pro.
     
  3. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Excellent.

    I'm assuming I can delete the base ttf fonts once I've created my TextMesh Pro (asset) fonts?
     
  4. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes.
     
  5. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    I purchased Text Mesh back in Unity 4 and am getting ready to start a new project but had been hesitant until the old assets have been updated to Unity 5 (since i've upgraded). I'm anticipating a busy weekend on my new game so I registered on your forums. (awaiting approval).

    Personally haven't purchased any new assets in the store unless it specifically says it's Unity 5 ready, so ya it could be hurting sales.
     
  6. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I approved your registration a few minutes ago. You will find the Unity 5.0 release of TextMesh Pro in the "TMPro - Alpha & Beta Releases" section of the user forum.

    Should you have any questions or require assistance, please post on the TextMesh Pro user forum or simply reach out to me via email if that is more convenient.

    In terms of updating the package on the AssetStore, I have no doubt it is hurting sales. I did revised the product description and graphic on the AssetStore to state that releases with support for the New UI and Unity 5.0 are available on the user forum. As to why I haven't updated the AssetStore package yet, I have made several posts about it here is a link to one of the latest.

    P.S. Sorry about the delay in getting you approved. I had gone to sleep at 6:00 AM the day before and slept for like 3 hours and simply crashed around 2:00 AM last night.
     
  7. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    No problem. Been following your thread and progress for quite some time, glad I'm finally embarking on a new game to start using it. :cool:
     
  8. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro's text auto sizing offers a 2X performance improvement over UI.Text best fit.
    Comparing TextMesh Pro - Text Auto Sizing to UI.Text - Best Fit


    See the following post on the TextMesh Pro user forum for profiler results.
     
  9. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    Hi, team.
    in unity5.1.0, i gave the following error message.

    Assets/TextMesh Pro/Editor/TMPro_SDFMaterialEditor.cs(551,68): error CS1061: Type `UnityEditor.UndoPropertyModification' does not contain a definition for `propertyModification' and no extension method `propertyModification' of type `UnityEditor.UndoPropertyModification' could be found (are you missing a using directive or an assembly reference?)

    unityeditor said about this line in code.
    PropertyModification modifiedProperties = modifications[0].propertyModification;

    could you help me?
     
  10. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Unity made some changes to their Undo / Redo API which are the cause of this error. This was already addressed in the latest release of TextMeshPro which is version 0.1.5 Beta 1.5 which has been available on the TMP User Forum since prior to the release of Unity 5.1.
     
  11. novel173707

    novel173707

    Joined:
    Nov 6, 2014
    Posts:
    2
    hi!
    I use this plugin in my game.When I upgrade unity3d to 5.1.0.This plugin has a problem that I don't know how to solve it.
    When I Opened a UI panel use the method of "gameobject.SetActive(true)".It opened after a long time.It is very inefficient.
    Then I found when a UI panel's font used the TextMesh Pro,It will opened slowly.
    It resume fast when I delete the TextMesh Pro component.
    somebody can tell me why and how to solve?
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I have been running Unity 5.1 for several weeks and there have been no reports of any performance differences between Unity 5.0 & 5.1 in terms of use of TextMeshPro.

    What version of TextMesh Pro are you using?

    Are you getting any errors?

    Can you post on the TextMesh Pro user forum and include some images of your scene hierarchy / setup and provide the steps to reproduce this issue? Make sure the images allow to see what components are used so I can reproduce your scene.
     
  13. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Hi,

    I have some question about Text Mesh Pro which sounds great !

    Can a Text Mesh Pro put inside a native UI component with a Scroll script ? Actually, what I want to know is, can Text Mesh Pro be scrollable ?

    Can a Text Mesh Pro be animate ?

    Thank you
     
  14. mayenco

    mayenco

    Joined:
    Jun 3, 2015
    Posts:
    18
    @Stephan B ,

    is it possible to control the depth of the text with TextMeshPro?That the text looks something like this:

     
  15. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Do you mean a ScrollRect?

    Here is an example of using TextMesh Pro with Unity's auto layout components and ScrollRect and UI Mask.



    Most of the properties of the text or material can be animated. The text itself can also be animated by modifying vertex attributes by creating / using a script to modify those vertex.

    Here is an example.

     
  16. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Margin Rich Text Tag
    The margin rich text tag provides control over the left and right margin of a line or paragraph of text within the same block / text object.

    upload_2015-6-16_16-19-54.png
     
  18. arcdragon1

    arcdragon1

    Joined:
    Oct 15, 2012
    Posts:
    116
    ok! thanks!
     
  19. mayenco

    mayenco

    Joined:
    Jun 3, 2015
    Posts:
    18
    Is there any tutorial on how to do this? I can't figure out which values I have to change, to get the depth.
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Volumetric mode isn't available yet. It was a preview of what could be possible. Having said that, it is on the short list of new features that I would like to release within the next 30 days or so.
     
    mayenco likes this.
  21. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Is textmesh pro bugged on unity 5.1.1 or what ? Any kind of effect - outline, underlay - adds black squares under my text.
     
  22. OhMyMeGames

    OhMyMeGames

    Joined:
    Mar 12, 2014
    Posts:
    4
    Has anyone had any luck with Inner shadow (Underlay) working? I cant get it to show at all.
     
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you post an image of that along with an image of the inspector panel selected as well as material editor panel so I can see the settings?
     
  24. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You have to play with the transparency of the face of the text. It is kind of tricky to play with. There is a thread / post related to Innder Underlay on the TMP User forum.
     
  25. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Nevermind, got it, had to increase padding to like 12.
     
  26. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Does textmesh pro support android 5.1 ? I made a simple scene with text "<b>My Text</b>", on unity everything works, but when i build it for android 5.1, results are very random : 1) when text = "<b>My Text</b>", text on android is visible, but not bold; 2) when text = "My Text", text is invisible on android; 3) also, transparency doesn't work on android too, i.e., i set color to Color(0.0f, 0.0f, 0.0f, 0.1f) to make text barely visible, but what i see is crystal clear black color without any transparency. Again, everything works ok when i play scene in unity or build it for windows, problems are only on android.

    What i see in unity :


    And in android i only see the middle part of text without bold tag. Not bold text is not shown and transparency of text is rounded to 1 or 0, so in my case it becomes totaly invisible.
    Example app for android : http://www21.zippyshare.com/v/c28ghFKW/file.html
     
    Last edited: Jun 20, 2015
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    What version of TextMesh Pro are you using?

    This has all been working on Android unless something changed in Android 5.1. I do have an Android capable of running 5.1 that I can test with so I'll get back to you on this.
     
  28. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey Stephan, is it possible to move the TextMesh Pro Folder from Assets/ to another folder like "Plugins" or "Standard Assets" in order to boost the compile time in the Editor? We use a bunch of other plugins and of course our own scripts and every time we edit our own scripts the compiler goes through each script there is in the whole project...
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes it is. Here is a post on the TMP User Forum showing how it can be moved to the plugins folder for instance. Since you will still be using C# forget the part about Unityscript / Javascript. http://digitalnativestudios.com/forum/index.php

    FYI: I have run into weird Unity issues when moving folder around so make a backup first.
     
  30. hattrik_4

    hattrik_4

    Joined:
    Apr 17, 2014
    Posts:
    4
    Hi Stephen,

    Haven't heard any updates, so am asking again regarding support for EZGui. I don't know the extent of the work needed on your end, so apologies if it's an unrealistic ask at this point.

    Thanks,

    Ryan
     
  31. Bruce_GMC

    Bruce_GMC

    Joined:
    Oct 23, 2014
    Posts:
    65
    Hey Stephan
    We've been using your TMP for a while now and every time we update unity, we have to add the version of unity after the header entries before it: UNITY_5_1 || so on..

    Sorry if this has been addressed but has this been fixed in newer versions of TMP? If not would it be possible to make TMP compile in Unity after a version upgrade. My head dev is saying updating TMP all the time is too much of a pain in the ass so I need to be sure that updating will fix this issue. To patch it I have added lines going up to unity_5_9 and it works for the time being. Any help?
     
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I revised those conditionals to use UNITY_5 which covers all Unity 5 versions.

    This change was incorporated in the latest beta release of TextMeshPro which 0.1.5 Beta 1.5. If you haven't updated to that version yet, you might wait until the next release which I am hoping will be sometime this week.
     
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Interacting with Text Objects using the TMP_TextUtilities Class
    Here is a quick overview of the new TMP_TextUtilities class which will make it possible to interact with characters, words, lines or links contained within a TMP text object.


     
  34. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Can someone try and confirm, that textmeshpro - text with transparency, bold text - works or doesnt work on android 4.x and 5.x (5.0, 5.1.1) ? I'm making android game, but i'm stuck with textmeshpro - for me bold text doesnt work and text transparency doesnt work. Standard unity's textmesh works, but this plugin doesnt work with android, and i dont know, what is wrong - plugin bug, unity bug or android bug.

    Edit : you can try my example from post #676 and you can try to make your own simple scene.
     
  35. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This has been working since the first beta was released. I was asking which version you are using because bold data used to be encoded in the Alpha which required special handling. Alpha from 0 - 127 means character was not bold and alpha 128 - 255 means the character was bold. This means if you are fading bold via scripting and changing vertex colors manually you need to account for that.

    This was changed in the latest releases of TextMeshPro where you don't have to worry about any of this.
     
  36. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    A TextMesh Pro user reach out to me asking how to implement and old style computer terminal simulation in TextMesh Pro. Here is what I came up with...



    This is using the same TextMeshPro.maxVisibleCharacters property which is used in the Reveal Text FX that I showed months ago. However since the text needs to be aligned at the bottom and based on the last visible line, I had to add new text alignment properties which are MaxVisibleLineLeft and MaxVisibleLineJustified.

    This is also using a UI,Mask component on the panel to mask the text as it reaches the top of the screen. This implementation works with Word Wrapping and all the other features / tags and doesn't use any string operations at all.
     
  37. fsouza

    fsouza

    Joined:
    Jun 11, 2015
    Posts:
    2
    Hey, I saw some older posts about NGUI and TMPro but they were not conclusive.
    Could you please let us know if the latest TMPro is compatible with the latest NGUI? Is there any extra effort involved in using them together??
     
  38. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are extra requirements in terms of having to deal with sorting layers and a special script need for masking. As far as I know everything is working but should you have any issues, I am certainly available to help.
     
  39. fsouza

    fsouza

    Joined:
    Jun 11, 2015
    Posts:
    2
    Cool thanks for the prompt reply. Where can I find this special script?
     
  40. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You will find information on the TextMesh Pro User Forum. Doing a search on NGUI should pull up a bunch of stuff.

    Here is a link to information related to Sorting Order http://digitalnativestudios.com/forum/index.php?topic=289.msg3169#msg3169

    The script to deal with Clipping / Masking is located in the following thread http://digitalnativestudios.com/forum/index.php?topic=330.0

    You'll need to make sure you get the latest release of TextMesh Pro from the user forum. Should you require assistance be sure to reach out to me and post on the user forum.
     
  41. fsouza

    fsouza

    Joined:
    Jun 11, 2015
    Posts:
    2
    Awesome, thanks!
     
  42. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    I'm currently sticking to unity's UI because font atlases are generated at runtime, transparently.
    It's a boon when publishing games that include japanese, chinese and russian, as dealing with multiple asset files is a pain.
    I can see how generating these distance field at runtime can be much more demanding, but just in case you're catering to the lazy, do you plan on doing that ?
     
  43. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are several reasons to consider TextMesh Pro. First is the benefits you get from the advanced text rendering and dynamic font styling. Second is the greatly improved text formatting and layout control and lastly the improved performance over UI.Text.

    In terms of using a Dynamic Font system, the only time it makes any sense is for handling languages like Chinese, Japanese and Korean which have large sets of characters. For any other languages including Russian (Cyrillic) a static font asset is much more flexible and efficient.

    In terms of Unity's Dynamic Font system, it has significant performance overhead while the font is being cached. By contrast static Font Asset has none. The TextMesh Pro font asset is static and works for any point size and virtually unlimited dynamic styles. Only one font asset is used for all variations.

    Unity's dynamic font system is also very inefficient in terms of character packing where characters are duplicated in order to deal with varying point sizes and styles (bold). By contrast you can create Font Assets in TextMesh pro that contain all the characters used in your game by choosing "Characters from File" or even include all the (3500) Frequently Used Characters for Chinese which cover 99.9% of uses. Russian (Cyrillic) as I mentioned before is a small set of characters which can easily be packed with all extended ASCII and even other languages if needed.

    The Dynamic system is only capable of dealing with plain characters. To be able to use fonts with outlines and other attributes, you need to switch to a static font in Unity which is then massively limited to static point size and one style. By contrast again, TextMesh Pro gives you all the flexibility you need where one font asset works for all point sizes and resolution and visual styles.

    Again, the only place where a Dynamic Font system makes sense is for CJK where there are so many characters which cannot all fit into a single texture atlas at 2048 X 2048 which is kind of the limit for mobile device. On desktop the limit is 8K X 8K at which point everything can pretty much fit.

    Having said that, I do have plans to introduce a Dynamic SDF Font System which will have less performance overhead then Unity system due to (1) only needing one representation of each character for any point size and (2) allowing pre-packing Font Asset with known characters ahead of time to minimize having to add those at run-time. It will also offer all the benefits of unlimited dynamic styling. No ETA yet on this system but it is something I really want to add.
     
  44. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Fantastic!
    Once you have that in place I'll switch over to TMpro, if I'm still making games by then :)
     
  45. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New Style Tag Overview
    Here is a video overview of the new Style rich text tag in TextMesh Pro which enables you to combine several tags into one for convenience.

     
  46. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMeshPro 0.1.5 Beta 2 Release Notes

    New Features
    • Most Rich Text Tag have been updated to allow values to be defined in pixel units (px), font units (em) or as percentage (%).
    • Added a new margin tag to allow defining a margin for a line or paragraph of text. This new tag can be specified as <margin=10%> which sets both the left and right margin to the specified value. The left and right margins can be controlled individually using <margin-left=10%> <margin-right=10%>. The margin tag can be defined in pixel units, font units and percentage of the text container's width. Use </margin> to end the effect of the margin tag.
    • Added a new tag to control the width of a line or paragraph of text. This new tag is <width=100px> <width=2em> <width=25%> </width>. Added a new Example Scene 06b - Margin Tag Example.
    • Added a new tag to allow defining links within a block of text. The link tag is defined as follows: <link="name">The text part of this link</link>. In conjunction with the addition of this new link tag, a new linkInfo[] array has been added to the TextMeshPro.textInfo class. See the following introduction video related to the link tag
    • Added a new Style macro tag which enables users to define / combine multiple tags into a single tag. This Style tag is defined as <style="name">Text affected by this tag</style>. Style tag definitions are stored in the "TMP_DefaultStyleSheet" asset found in the Resources folder. Style tags can be managed by navigating and selecting this "TMP_DefaultStyleSheet" asset. See the following video
    • Added a new vertical offset tag to allow shifting characters and / or words contained within this tag. The tag is defined as <voffet=0.5em> <voffset=10px> </voffset>.
    • Added a new tag to indent the first line of text of a line or paragraph. This new tag is <line-indent=10px> <line-indent=5em> <line-indent=10%> <line-indent>.
    • Added the ability to define non-breaking spaces using the <nobr> <nobr> tag.
    • Revised and improved the implementation of Underline & Strikethrough style. Underline and Strikethrough now take into consideration point size. These changes also now make it possible to reveal text using underline or strikethrough.
    • Added a new Text Auto-size function where the width of the text can be reduced as a % before the point size is reduced. This is great for numerical sequences when trying to squeeze in a few more digits without changing point size which is typically more obviously visually. Please see the following video about this feature.
    • Added the TMP_TextUtilities class which contains several functions to track a position in relation to any characters, words, links or lines of text. These functions can be used to implement functions to interact with the text object. Please see the following video for more information

      This new release also includes a new example scene "06c - Link Example" which makes use of this new utility class.

    Fixes & Improvements
    • Revised how events are subscribed to in the editor when text objects are Enabled and Disabled. This change has resulted in removing all allocations related to enabling and disabling text objects as well as performance improvements.
    • Fixed a few shader issues steaming from Unity now computing lighting in world space as opposed to object space.
    • Improved how text is aligned vertically when using maxVisibleCharacters and maxVisibleLines. Here is an example https://lh3.googleusercontent.com/gsaFUfSfejPjnisxSeF09awKII6Wx2RUYqDhH8UxNA4=w1280-h640-no
    • Fixed some minor inaccuracies in the textInfo data. Added a new script "TMP_TextInfoDebugTool.cs" which can be added to any TMP object to visualize the data contained in the textInfo class.
    • Revised how tags are now parsed to make it possible to support more complex tags like <font="Arial SDF" material="Arial Shadow"> in the future.
    • Modified vertex colors so that only the alpha will affect the sprites used in the text object.
    • The Page Number used by the Overflow Page Mode now starts at 1. The array index for the first page remains 0. (FYI)
    • It is now possible to use Graphic.color to affect the vertex color of text objects.
    • Text objects now respond to Events in Unity like UI.Text objects do.
    • Removed the experimental Mobile Distance Field II Shader which was causing build errors on mobile platforms.
    • Font Asset Creator window is now using the new EditorWindow.titleContent and added compiler conditional to continue to use "EditorWindow.title" with older Unity 5 and 4 versions.
    • Added compiler conditional for Reset() and OnValidate() to get a round a new Unity bug introduced in 5.1.
    • Mesh Renderer received and cast shadow are no longer forced to off.
    • Few minor tweaks related to Unity's Layout Components.
    • Fixed some rounding error related to text auto-sizing (at small point sizes).

    Note: This is a partial list of the new additions and changes between Release 0.1.5 Beta 1.5 and this new Release 0.1.5 Beta 2.
     
  47. noania

    noania

    Joined:
    Apr 19, 2014
    Posts:
    33
    Hello. Is there a way to "Edit"(like changing character set and font size) the TextMesh Pro Font Asset you made? There's a time when you want to just add 1 or 2 extra character to the font asset but currently, to do so, you have to make a new asset and overwrite the previous one( meaning you have to remember all the values from the previous setup and manually enter them).
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There isn't any way at the moment since the texture gets filled pretty much completely to maximize sampling size.

    Basically you have to override the previous one. In terms of the settings, padding is kind of the only thing that changes besides the characters. To handle characters, I typically use "characters from file" where I add all the characters in it and give it a name to know what font it is for.

    At some point I would like to revisit this part of font asset creation and find a way to reuse those settings.
     
  49. noania

    noania

    Joined:
    Apr 19, 2014
    Posts:
    33
    Thanks, sounds like using "characters from file" will work for me. I needed something to refer previous settings(especially characters) when rebuilding font is needed.
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yeah. Just keep a text file that you revise to keep a list of characters you use. :)

    P.S. Make sure you save the text file in UTF-8 or Unicode if you want to make sure characters other than ASCII are included.
     
    Last edited: Jul 7, 2015
Thread Status:
Not open for further replies.