Search Unity

TextMesh Pro - Advanced Text Rendering for Unity - Beta now available in Asset Store

Discussion in 'Works In Progress - Archive' started by Stephan-B, Feb 11, 2014.

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

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    30
    You are dragging the gameobject and not the component on the gameobject (very easy to do) -
    You will need to either lock the playmaker window OR the inspector when you select the text game object (unless the FSM is on that object)
    Then in the inspector where it says "Text Mesh Pro (script)" click and drag that into the Set Property target Object slot.

    Also the new align stuff is looking awesome Stephan B
     
  2. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    That's what I did (in the screenshot the first 'set property'), I drag&dropped the component and it show all correct properties. Wait... Ahh! now I got it! My fault was that I clicked on the little circle where a popup-window opens and I then choose an element from the scene. But this is only the gameobject like you said. Dragging the component in the target slot solves it.

    Thanks a lot @LampRabbit
     
    LampRabbit likes this.
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks, that did the trick.
     
  4. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks for adding the align option Stephan! By the way is the new version already downloadable? (I'm not too sure where to look for it)
     
  5. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you for suggesting it :)

    The version with this new feature hasn't been released yet as I am still adding support for UI Mask which will also be in that release.

    In terms of how / where to get access to those beta releases, they are available to any TextMesh Pro user who wishes to help in the testing process of those beta releases.

    Since those beta releases are available in the Private Beta Group Section of the TextMesh Pro User Forum users will need to first register on the TextMesh Pro User Forum and then send me a private message indicating they wish to have access to the Private Beta Group or send me a private message here along with their username on the TextMesh Pro User Forum also indicating they wish to join the Private Beta Group or email me with the same information.
     
  6. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Hi Stephan,

    do you have the text-input in playmode already implemented? Can't find it.

    And I have another suggestion or a question. What is the best/easiest way to add special chars as Umlaute (äöüÄÖÜß) and others? I would have thought that I could simply do a copy&paste of all the characters I need, but it seems as if I have to enter all the ascii-codes, tedious imho.

    Oh yes, I forgot to write a 5-star review for your asset, will do asap :)
     
  7. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It isn't available yet but once I release the next Beta, I will finally be able to focus back on that Component.

    Cut & Paste in the Font Asset Creator using the Custom Character mode should work.



    Thank you :)

    P.S. After I am done with the Run-time Input Component, I can revisit the Font Asset Creator to maybe enable it to use a combination of different modes. Not sure yet how to implement it but a way to pick like Extended AscII and then manually add some extra characters or something. Not sure yet.

    On the flip side, you can always use the Characters from file. If you always end up using the same set, you could create that file once and then keep reusing it. The only issue I ran into with that is that Unity requires UTF-8 encoding of that text file if i recall correctly. I had one user reporting that the characters with accents were not coming getting generated and that was the issue. I use a TextAsset which apparently has some encoding requirements.
     
  8. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Cool, this is one feature I will really need.
    Ah, yes, good enough. thx.

    Done. You really earned yourself the 5 stars.

    No need to spend too much time with this. Being able to have the extended ascii and then adding some special codes would be nice, but I can work fine with how it is now, just a little more one-time work.
     
  9. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I have several users who really need this feature. I was making great progress but then Unity 4.6 went into public beta so I had to switch back to working on getting that ready.

    Thanks buddy :)
     
  10. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Tomorrow will be a full day of testing. Unless I run into some unforeseen issues on my end or with the new Unity 4.6 RC2, I should have a new Beta release available to registered users of TextMesh Pro on the user forum by the end of the day.
     
  11. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Please excuse if I am asking dumb things but it is late over here. Better said 2:30 AM ;-)
    When the Unity Manual is talking about their build in Texmesh stuff they are also talking about road signs. I tried do it and failed. After a lot of trial and error the text mesh at least doesn't get rendered above everything. But still it lacks in some vital areas like usefull normals.
    I don't want to do Rocket Science Stuff. All I need is a working text on top of a road sign. Text mesh seems to be able to handle that task but I better ask before I buy. As far as I can see you are working on a U4.6 compatible version and I hope a 5.x version will follow. I'd love to use the new standard shader for my fonts in order to make them behave like the rest of the sign. However that failed because of missing normals and the simple fact that TTF fonts are allways black and the diffuse color is multiplied. Can I add whatever shader I want to the text meshes of TMP?

    TIA
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are no dumb questions. Thank you for taking the time to ask.

    Using TextMesh Pro's surface shaders (mobile and non-mobile) will do that. Take a look at the Surface Shader Web Demo in my signature.

    Once I am done with the support for Unity 4.6, my focus will be shifting to Unity 5.0. Interestingly, I already have users using TextMesh Pro with Unity 5.0.

    TextMesh Pro requires special shaders since it uses a different text rendering system.

    TextMesh Pro includes different shaders. The surface shaders which allow the text to be affected by scene lighting would be the ones you would want to use for your application. Take a look at the following video which should be informative but more relevant you can see how moving a light affects the text around 8:51 into the video.



    In terms of the new PBS shaders in Unity 5.0, I will have to take a look and see if it makes sense to create additional shaders for TextMesh Pro that would use PBS. I am uncertain at this stage how much they would offer vs the surface shaders considering we are talking about text.
     
    toxtronyx likes this.
  13. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Thank you for your answer! The video is looking great and somehow a big load of ideas how to use it are popping up in front of my inner eye ;-)
    Regarding the shaders. the Demo looks really impressive. However it is still hard to tell how they behave next to symbols using the standard shader. It wouldn't be much of a problem I guess if the textmesh is somewhat stand alone.
    But anyway I am most likely going to buy TMP. Btw. in my oppinion the auto API updater works not as expected. I already had the situation that multiple reimports of the same asset into the same project lead to anything between 100% functionality and compiler errors making the project unable to build.

    Cheers
     
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You will have to experiment with all of that. I think it will be ok visually because in the case of a sign, the material of the sign isn't expected to be the same as the text otherwise the text would not be readable. Now since both the sign material and the text will be affected by the same lighting I doubt there will be much visual difference in terms of the lighting itself.

    So far the Unity 5.0 updater has worked for me but once I get around to the Unity 5.0, I will be updating all those component references and changes. Having to use the updater is just temporary.
     
    toxtronyx likes this.
  15. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Font Asset Padding
    When creating an SDF Font Asset in TextMesh Pro, the padding determines the spread on the distance field. The spread affects the range of most property like Dilation, Outline, Underlay, Glow, etc...

    Typically a padding value of 5 for a 512 X 512 Font Asset is fine for most use. However, there may be times where you need extra range on Glow or Shadows for instance. In these cases, you can increase the padding size. Here is an example of a Font Asset where the padding was increased from 5 to 12.



    Increasing the padding size will result in a smaller sampling point size for the font which means it won't be as accurate as a larger font. This can be a marginal thing depending on the font. Larger padding size will result in the computation of the Signed Distance Field asset taking potentially a lot more time to compute. A padding of 5 in a 512 X 512 is the same as padding of 10 in a 1024 X 1024 Font Asset.
     
  16. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Great Explanation! Thanks. (Btw, how is the input coming along? ;))
     
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Just a variation on the above text with added texture, bevel and glow + UV animation

     
  18. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    I just got it.

    Very intuitive and very slick looking.

    Thanks for making this awesome add on!
     
  19. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    Sorry for the double post, but does anyone know how to change the text in JS?
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you for your support and choosing TextMesh Pro.

    Here is a post from the TextMesh Pro User Forum explaining how to get it to work with Javascript.

    http://digitalnativestudios.com/forum/index.php?topic=224.0
     
    Not_Sure likes this.
  21. LampRabbit

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    30
    Hi Stephan,

    I have a few fonts that only have Capital characters so when I generate my font I only include these characters. However when using unity standard text mesh a lowercase character would display the correct uppercase. Text mesh pro does not do this. Figured it might be a welcomed addition.
     
  22. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    That is a good suggestion which is why I added this feature to TextMesh Pro maybe a week ago or so along with the ability to force Uppercase, Lowercase and Smallcaps styles. See this post for some additional information.
     
    hippocoder likes this.
  24. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Does TextMesh Pro support realtime (3D) shadows being cast on the text?
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The text can cast shadows in the scene using the surface shaders but cannot receive shadows.
     
  26. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Drat, because that is the thing I need. :(
     
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The issue comes from text being transparent and thus rendered in the transparent queue which is after the other objects which would cast a shadow on it have been rendered.

    This isn't a TextMesh Pro thing or even a Unity thing but how rendering works.
     
  28. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Just purchased this, it made a big difference using the Oculus Rift DK2! Is there a way to set/replace Unity's default text system /globally with TMP? Otherwise there are other assets with code in them for text that I would have to hunt & replace.. I am not a programmer and would just like an easy button.. tell me there is an easy button ok? :D I've looked around in Unity for a way to swap it.. the only thing I found was the UI/Default Font shader in the Graphics settings. I don't know how your code works if it would be as simple as changing the shader but maybe you might know if it's good to or not good to completely swap Unity's Font/shader System?
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I wish there was an easy button to replace all the fuzzy and bad looking text in one swoop ;)

    What makes the text render better is a combination of the shaders, Signed Distance Field font asset and custom data passed to the shader. So replacing the shaders alone won't do it.

    Which other Unity text system do you currently use and would like to replace?

    TextMesh Pro can already easily replace TextMesh and GUI Text and with the latest beta release, replace the Unity 4.6 Text as well.
     
  30. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    I'm running in to an error with Unity 5.0.0b14 x64 and TextMesh Pro v0.1.46B2.4 when I open the font maker.

    TextMesh Pro Unity 5 x64 error.JPG

    To me it looks like an issue with an x64 version of the dll being missing?
     
  31. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It is not missing. It does not exist :) (well not in the current package).

    Just run over to the TextMesh Pro User Forum, follow this link to get the 64 bit dll.

    P.S. I just released a new beta of TextMesh Pro for Unity 4.6. Once I am done with support for Unity 4.6, I'll move on to Unity 5.0 which I haven't really had much time to play with yet.
     
  32. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Excellent, thanks I'll check that out.
     
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Animating Vertices per Character
    Using TextMeshPro.textInfo.characterInfo[] to access information about each of the characters in a block of text, I applied a simple matrix rotation to rotate / reveal each character.


    The gif animation didn't come out too good but you get the idea.

    Here is an image of the text object selected in the editor.
     
  34. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Text Overflow - Page Mode
    I just added a new feature in TextMesh Pro which allows you to control / break blocks of text into pages. Basically instead of Truncating the text that doesn't fit inside a Text Container or RectTransform, it is broken into pages. A new property public int pageToDisplay; which is also exposed in the editor allows you to control which page is shown.

    Instead of using string manipulation to control which portion of the text is shown or creating additional text objects with subsets of the text, this new feature is very efficient as it controls which portion of the mesh is visible by simply degenerating vertices that should not be visible. Since the text is never changed, rich text tags, alignment, word wrapping and all other text layout is preserved.

    Here is a short video showing this new feature.
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Would this "text overflow" feature have any application for dialogue balloons?
     
  36. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It would anytime you have more content to show then the size of the Text Container / RectTransform. So if the dialogue doesn't fit inside a balloon, you could use the Text Overflow - Page mode and instead of having a button to move to the next page, you could have timer or something that automatically switches to the next page.
     
  37. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
  38. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Is Unity4.6 UI support available in the latest version? if so how do I create Unity4.6 UI label that uses TextMesh pro? if not any ETA on the support?
     
  39. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Support for Unity 4.6 and the new UI has been available in the past few beta releases of TextMesh Pro which is available to Registered User on the TextMesh Pro User Forum.

    In the latest beta release, adding a TextMeshPro UI object is done using the Create Menu just like you do with Unity 4.6. Instead of selecting <Create - UI - Text>, you select <Create - UI - TextMeshPro Text>.

    Although the following video focuses on support for UI Mask with the new UI and TextMesh Pro, it does show how to add a label to a button for instance.

     
    Last edited: Dec 12, 2014
  40. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm trying to set up some text on a curve -- just a simple arc. I've added the Advanced Layout script to my TMP text, and tried the Translation and Scale curves. Both do something, but neither simply bends the text around the curve that I create in the curve editor. (And when I change that curve, the text doesn't update to the new curve.) Am I doing something wrong? I can't find anything about curves in the documentation pdf.
     

    Attached Files:

  41. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    What version of Unity and TextMesh Pro are you running? With the first Beta Release of TextMesh Pro version 0.1.46, I also included a Demo & Extra Content package which includes a few new script examples. One of those scripts was used to create the following example.



    The Advanced Text Layout Component was a prototype and sort of paved the way for these newer and more efficient implementations.

    To get access to this Demo & Extra Content, make sure you register to the TextMesh Pro User Forum. This will then get you access to the latest beta releases with support for Unity 4.6 as well. This demo package can be found in the Beta Release 0.1.46 B2.4 found in the TMPro Alpha & Beta Releases section of the forum.
     
  42. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New Rich Text Tag - Monospaced
    This new rich text tag will forcing character spacing to be monospaced. The new tag format is <mspace=xx.x> </mspace>.

    Here is an example showing this new tag along with a few newly added ones.
     
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I have Beta Release 0.1.44. So the curved text is still in beta?

    I've registered on the forum now, so as soon as you approve me (username "gecko64") I'll grab that newer beta.
     
  44. Stephan-B

    Stephan-B

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

    I just approved your registration. Make sure you get Beta Release 0.1.46 B3.2 but download also the Demo & Extra Content from the Beta Release 0.1.46 B2.4 thread.

    P.S. Since almost everyone downloading the latest beta is using Unity 4.6, I will double check to make this latest package is still ok with Unity 4.3 +. It should be I didn't test it since the last release oops!

    EDIT : Found one minor issue with the package in Unity 4.3. Line 648 in the TMPro_SDFMaterialEditor.cs will need to be changed to this.
    Code (csharp):
    1. Undo.RecordObject(go.GetComponent<TextMeshPro>(), "Material Assignment");
    I will update the package of course but just in case you download it faster than I can upload a new one.

    These examples are using the normal TextMesh Pro Component which you are currently using so they should work out the gate for you.

    P.S.S. I am also checking the Demo & Extra Content Package in Unity 4.3.

    EDIT: That package contains tons of test scenes for Unity 4.6. Give me about 30 minutes to update it so it works in Unity 4.3+ as well.

    P.S.S Cube Power: I just uploaded two new packages which will work in Unity 4.3 along with a revised Demo & Extra Content package as well. Those will be found in the "Topic: Revised Demo & Extra Content for Unity 4.3 (NOT Unity 4.6)" thread along with instructions for you.
     
    Last edited: Dec 12, 2014
  45. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Okay, I've got the latest beta and the demo stuff. I'm trying to tweak the Halloween demo so is has the kind of curve I want -- but the first and last letters are outside the curve. How do I get the entire string of text to follow the curve?
     

    Attached Files:

  46. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I think they are outside because the curve may have ease-in and ease-out. Go in the curve editor to edit that.

    The script is also provided to show how it can be warped on a curve. The curve is simply evaluated and those values are used to position and rotate each letter. Instead of an animation curve, you could also implement and provide this via an equation.
     
  47. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Got it, Thanks a lot!
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New! Text Indentation Tag
    I just added a new rich text tag which provides control over character indentation within the same block of text.

     
  49. Raimis

    Raimis

    Joined:
    Aug 27, 2014
    Posts:
    160
    Hi, we are considering buying your plugin, but I have few questions (wasn't able to find a direct answers easily). Does using 4.6 TMP control allow to scale text down/up without loosing sharpness? Let's say we use font size 64 in the textfield and then show it at 0.5 scale or 2.0 does it remain sharp or should we switch font size on the way too? Even though 4.6ui has bunch of performance problems, how does current beta compare to native 4.6 text control? Does using TMP for static texts have any impact on performance? thanks in advance for your answers.
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The text will remain sharp and clean at any point size, resolution and scales linearly. Since TextMesh Pro uses a different text rendering technique, only one font asset is required per font type to render at any size. Furthermore by using different materials (presets) you can change the look of this font to dynamically add outline, shadows, bevel, glow, etc...

    I have created several videos which explain this varying degrees but this more recent one goes over it quickly but will also give you a glimpse of additional functionality in the tool over the UI Text in Unity 4.6.



    Only one single font asset is used for all point sizes and resolutions. Scaling must be uniform (ie. X, Y, Z) most people forget about Z which would cause the text not to render correctly.

    In terms of performance, the TextMesh Pro UGUI component uses the CanvasRenderer and as such inherits the same overhead as UI Text or anything rendered using CanvasRenderer. The normal TextMesh Pro component which uses the Mesh Renderer should still be used for text in a scene as it doesn't inherit this additional overhead and thus offers better performance.

    BTW: UI Text or TextMesh Pro will have similar performance, the performance overhead comes from the Canvas system and Unity having to do extra processing to try to batch all these elements into fewer draw calls. As Unity improves that part of Unity 4.6, performance will improve for all components using the Canvas system.

    In terms of Text Control, TextMesh Pro offers substantially more control over your text than UI Text. The previous video should give you a good idea but just in case, TextMesh Pro offers control over character, line and paragraph spacing, kerning, numerous additional rich text tags to control text alignment within the body of the text or indentation, new page overflow mode, support for superscript, subscript, smallcaps, and more. Here is an image of a few of the newer tags added.



    Example showing some of the tag that provide control over text alignment within the body of the text.
     
Thread Status:
Not open for further replies.