Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

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

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    Thanks!
    The EULA thing was just an example, perhaps not a very good one :)
    Sometimes I have customers wanting to update text (product desriptions or data sheets) in the their app via an web cms or similar. There I have no control over the amount of text they gonna put in.
    I understand that this is a very niche use case but It would be nice if we can use as much text as we want in the future without thinking too much about performance.
     
  2. sschaem

    sschaem

    Joined:
    Feb 14, 2014
    Posts:
    148
    Split your document into pages and append the pages one after another.

    If its dynamic text, simply split the text after N characters and at the next newline/break.
    5,000 character per object seem like a good threshold.

    (The TMPro API will let you append the object one after another from their bounds.)

    a) Any page offscreen wont be considered in the rendering processs : Unity uses bounds for visibility and will completly ignore anything offscreen. so if you have 1,000 pages, no performance hit.

    b) Any character offscreen are not rendered and will not impact the fill rate in any way.

    c) The TMPro shader is extremely lightweight, and you should be able to scroll full screen pages of text at 60hz (on old mobile)
     
    Last edited: Jun 10, 2014
  3. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The EULA example was extreme due to it having over 20,000 visible characters. That would be a pretty crazy product description / data sheet. As both Stephan and I stated, there a various ways you could manage this with TextMesh Pro and get great results on mobile.

    P.S. When I have a few minutes to spare, I'll built a demo of this.
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Hey guys, we've shipped the first product with TextMesh Pro! It's called NEXEFX, here's a link:
    https://itunes.apple.com/us/app/nexefx/id871609596?mt=12

    And here's a video trailer of TextMesh Pro:

    Here's a few promo codes:
    79ERW39MPJKR
    JK7X6WT9J69N
    TNKRWL93EEEN
    KPF74TFA94AL
    T747N4K393RL

    It demonstrates a wide variety of the features from TextMesh Pro, including changing fonts, applying bevel, applying stroke, and font size.
     
    Last edited: Jun 11, 2014
  5. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Congratulations!

    NEXEFX looks pretty cool. May the Apple App store Gods smile upon you and deliver 100,000's of customers to you :)
     
    User340 likes this.
  6. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Masking & Clipping of Text
    I made a reference to masking in a previous post. Here is a preview of masking options which will be using the new RectTransform that will be available when Unity 4.6 is released.


    Clipping



    Hard Mask



    Soft Mask
     
  7. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    85
    I just bought this for mobile game development and am disappointed that the majority of the effects aren't supported in the mobile shader (http://screencast.com/t/ltaZC3uo).

    Will the non-mobile shader still work on mobile devices?

    edit: on page 1 now I see that you already said, "Our mobile shaders were highly optimized for those mobile platforms. Even our shaders that are not labeled as mobile still perform great." So, it seems like it should be ok to have a handful of texts on the screen that use the non-mobile shader.
     
    Last edited: Jun 12, 2014
  8. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes they will :)

    Most of TextMesh Pro's shaders use "shader keywords" to enable / disable features. Some of those features are more taxing on the gpu then others. For instance, using the normal SDF shader and using textures, underlay and glow doesn't impact performance much but enabling the bevel options does. Having said that even the Surface shader which is really designed for Desktop still only requires OpenGL ES 2.0 and works on mobile devices.

    My advice is for you to test those various shaders on your devices to measure their performance for your application. As I said, these were highly optimized and should perform extremely well with the exception of the full surface shader which is really designed for Desktop. Please sign up to the TextMesh Pro support forum and share your results with us and examples of what you do :)

    Thank you for your support and feel free to reach out should you have any issue.
     
  9. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Text Truncating & Ellipsis
    One of the features that was requested in the WIP Thread was using Ellipsis to indicate when a line or paragraph of text is truncated. As part of the improvements to line justification which will be part of the next Beta Release 0.1.44, I was able to add this new feature which works in conjunction with TextMeshPro.maxVisibleLine property.

     
  10. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Clipping, Hard Mask and Soft Mask are very nice. But, can they will do in run-time?
     
  11. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes. If you take a look at this video preview of the margin feature, you will see the masking in affect or take a look at the Surface Shader Web Demo in my signature where you can see the scrolling text on the left using a soft mask as it goes outside the mask bounds.
     
    Last edited: Jun 13, 2014
  12. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks for the reply.
     
  13. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You are welcome.

    BTW: I had forgotten to link the video I was referring to. The masking portion is towards the end of that video.
     
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The next Beta Release 0.1.44 is about ready to be submitted to Unity. Here are the changes.

    Beta Release 0.1.44 Change Log
    • Improved text alignment / anchor positions to be more consistent with how it is handled in MS Word.
    • Improved Justified text alignment to now support multiple paragraphs of text.
    • Ellipsis or "..." is now inserted in the place of the last 3 visible characters of the last visible line of text when the text is truncated.
    • New Orthographic mode option has been added in the TMPro Editor Inspector. This new option matches the scale used by GUIText. Please note the Camera size must be set properly to get correct scaling. In addition it is no longer necessary to set Perspective Filter to 0 for Orthographic mode as this is handled in the shaders now.
    • Added a new option in the TMPro Editor Inspector to enable or disable Rich Text tag support.
    • Added new TextMeshPro.maxVisibleCharacters() which controls how many characters will be visible. This can be animated via script to reveal part of the text / string supplied.
    • Added new TextMeshPro.maxVisibleLines() which controls how many lines of text will be visible. This can be animated via script to reveal part of the text / string supplied.
    • Added a new tag <space=000.00> which adds x amount of space before the next character.
    • Fixed an issue with negative numbers when using tags like <pos=-10.0> or <space=-10.5>.
    • Changed italic shear to ignore extra mesh padding.
    • Color tags new support a 4th Hex pair to allow control over Alpha.
    • Atlas Copy & Paste in the Material Context menu now also copies the Gradient Scale property as well as texture atlas size.
    • Revised the SetText() function to remove the use of generic types and iConvertible interface which were causing issues on some platforms and with JIT Compile Mode. New function only accepts floats now. However, given users are able to control the number of decimal points shown, I am not certain it is necessary to add additional overloads.
    • Changed the Text Object data structure which is now contained inside TextMeshPro.textInfo. The TextInfo class contains text metrics like character, word, space and line count. A new LineInfo[] which contains similar metrics for each lines, including their length is also contained in .textInfo. Lastly, the .meshInfo structure includes the mesh information which includes vertices, uvs, vertex colors, etc.
    • Added a new function - TextInfo GetTextInfo(string text) which returns the TextInfo for the supplied string without generating the text object itself.
    • Reworked and moved the mesh and data structure allocations out of OnEnable() and into Awake() which allows most of this data to remain persistent and greatly reduces reallocation when the object is Disabled and Re-Enabled via GameObject.SetActive().
    • TextMesh Pro Asset folder can now be relocated to alternative locations provided they follow Unity's special folder rules in terms of Scripts / Editor Scripts.
    • Adjusted xAdvance for bold characters to be more consistent with how it appears in Photoshop or Word for instance.

    So if all goes well this new version should be available within the next 3 - 4 days in the Asset Store.
     
  15. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Beta Release 0.1.44 has been submitted to Unity.
     
  16. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro - Featured on the Home page of the Unity Asset Store
    Today I am very grateful that the kind folks at Unity have decided to feature TextMesh Pro on the home page of the asset store.

    This would not have been possible without those of you who have been supportive of the product. A huge thank you to everyone who has chosen to purchase TextMesh Pro and for your amazing reviews thus far.

    As I said before, this is just the beginning. You have my commitment that I will do everything I can to make sure TextMesh Pro lives up to expectations and proves to be a great tool for your Unity projects and games.
     
    DenilsonSilva likes this.
  17. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This tool looks really nice. Does this tool just use the standard unity store license or does it have a different license?

    Also does this tool handle Japanese fonts?

    Many years ago I purchased a book on the subject on handling CJKV (Chinese/Japanese/Korean/Vietnamese) character handling. The author of the book works at Adobe working with such characters.

    CJKV Information Processing, 2nd Edition
    Print ISBN: 978-0-596-51447-1
     
  18. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you and yes It does use the standard Unity Asset Store License agreement.

    You can generate font assets using custom range of characters like Japanese. Packing large quantities of characters into an atlas can be a challenge but given Signed Distance Field enables us to raster the font at smaller point size (thus packing more characters into an equal size atlas) and yet deliver better visual quality than bitmap fonts, helps.

    Generating Font Assets containing 1000's of characters can be tricky but we do have some tips on how to best handle it on the TextMesh Pro user forum.

    Another aspect of our Font Asset Creator that can be helpful is the fact you can supply a list (file) of characters to add to the Font Asset. This way, instead of generating 1000's upon 1000's of characters, you can generate only those used in your title. Now if your game features a Chat then that isn't as helpful but for most games, rarely are all characters used.

    The last part, is although TMPro supports word wrapping, I still need to get around to adding proper word wrapping for East Asian Languages. It is on my TODO list.

    Additional information can also be found in our WIP Thread on the Unity Forums here.

    I'll take a look at it :)
     
  19. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Great job man
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thanks :)
     
  21. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197
    Wow, for what this does, $65 is a bargain. That's only the cost of hiring a talented programmer for one hour (or two if you're lucky).

    How is this used for GUI and HUD situations? I'm not familiar with Unity's text meshes, so I can't draw the comparison. Can you set a TextMesh Pro object to always face you, and stay in the same screen position (times, scores).
    (Parent it to the camera?)

    I use Daikon Forge for my GUI. Could this be adapted to replace the text on their buttons and labels?

    Even if GUI is out of the picture (shame if it is), it may have a purpose as my main menu title font (or all menu titles). (Ok, then the $65 isn't so tempting! But I know I'll break down.)
     
  22. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197
    This SDF concept could be applied to GUI elements also. If your various elements could be created in a font editor, it would be that much easier.

    That way the UI would scale as nicely as your text. Even 9-slicing would work, I think. Plus your effects like borders and beveling. Any time for a spin off GUI project? :)
     
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Obviously I am bias here but I agree. Furthermore, besides the programming time saved, given the dynamic nature and flexibility of TextMesh Pro when it comes to font styling and texturing, the amount of time you will save not having to use external tools and messing around with Photoshop will be worth it alone.

    It works in those situations as well. If you take a look at the Web Demos in my signature or in this Thread, I am using a frame counter and overlay for the camera move instructions.

    I haven't tried it with Daikon Forge but I do have users using it with NGUI as a replacement for their UILabel. There is thread on the TextMesh Pro forum related to that.
     
  24. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It could definitely be applied to that and more. Go take a look at the Area 51 section of the TextMesh Pro forum. More specifically the Volumetric Text we are exploring.
     
  25. sschaem

    sschaem

    Joined:
    Feb 14, 2014
    Posts:
    148
    To many UI system already available, and from what Unity seem to hint, UGUI is month if not weeks away.

    TMPro integrate with UGUI, So good news if you plan to use UGUI :)

    And we have NGUI users already leveraging TMPro in there production.
    (There was a few hurdle, but those got solved weeks ago)

    Now, one thing one the radar, should be of interest if you do 3D UI, is this:

    http://forum.unity3d.com/threads/new-3d-text-technology-for-unity-5-0.251254/
    proof10e.jpg

    Its a novel rendering technology where we do the geometric re-construction in a Dx9 class pixel shader.
    So you can add fully volumetric text to your UI... (or game scene)
     
  26. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I just wanted to cycle back on this post to say that I added the option for users to pick packing modes for the Font Asset Creator. The packing modes are Fast and Optimum. Fast is substantially faster and should be used with large sets of characters (anything above 500 or so) should use this mode. The trade off for the speed is packing efficiency which results in point size sampling being marginally smaller.

    In terms of what those performance and point size differences are:
    Arial (1278 characters) Fast Mode - 5.5 seconds - 30 pts.
    Arial (1278 characters) Optimum Mode - 1.07 minutes - 31 pts.

    So a marginal sampling difference for a whole lot more speed.
     
  27. sschaem

    sschaem

    Joined:
    Feb 14, 2014
    Posts:
    148
    Back to the UI thing: I guess you could make some cute little interactive UI element with this.
    As a test I put the ascii character on a slab.. but yes, it could be any shape.

    ui2.jpg
    (I only have unity free, so I'm doing my own soft shadows... not perfect yet)

    volume.jpg
     
  28. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I know I am totally bias here but that still looking pretty amazing. :)
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Area 51 is a section of the TextMesh Pro User Forum where we expose our users to some of the features and options we are exploring. As this is research, not all these features may pan out to be viable or of interest to our users but the only way to find out is by trying stuff out and getting your feedback and level of interest.

    So go check out the TextMesh Pro User Forum and Area 51.
     
  30. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro currently uses Signed Distance Field to dynamically render and style the text in Unity. Although we are able to simulate a 3D look by adding beveling and lighting effects, the text remains a 2D object.

    As per my post above related to exploring potential new features, here is a look at a new text rendering technique currently being explored. What's is the difference, well take a look at the video below. Instead of the letters being 2D objects, using this new technique, the letters are 3D objects.



    Visit the TextMesh Pro forum for more details.
     
    Last edited: Jun 20, 2014
  31. Nikola-B

    Nikola-B

    Joined:
    Jan 31, 2014
    Posts:
    42
    How can make an outline that is added just to the outside of the text?
     
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Outline is added at the edge and grows inwards & outwards. If having the Outline grow into the face of the character is not ideal, you can use Dilate to inflate the character to compensate. Here are a few examples:


    Image of the text - plain



    Image of text with an Outline extends both inward and outward. This makes the characters appear thinner.


    Image of text with the same Outline but with added Dilation to compensate for the outline. Face surface area is the same is the first image but now the Outline is effectively added on the outside of the face.


    Image of the same text but with an added soft drop shadow. Why? Just because we can :)

    Hopefully this answers your question. Let me know if you need further assistance.


    P.S. As a side note, all 4 of these examples are still using the same Arial SDF Font Asset. The only difference between these 4 text objects is their style which is amount to different material properties. Essentially, we are looking at the same Font Asset with 4 different materials.
     
  33. Nikola-B

    Nikola-B

    Joined:
    Jan 31, 2014
    Posts:
    42
    Thanks for the explanation.
     
  34. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a video showing the process of adding an Outline as well as a Soft Drop Shadow to the text.

     
  35. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Text Texturing Option in TextMesh Pro
    About a week ago, I mentioned that I was going to create a short video to go over the various text (face & outline) texturing options in Text Mesh Pro. Well here it is :)

     
  36. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks for the information. I have been reading as much as I can on this subject. This is a really exciting development.

    (1) Do you plan on supporting Drop Caps? (Here are few references)

    book: The Complete Manual of Typography, (first edition was published in 2003) (see page 211)
    ISBN: 0-321-12730-7
    (NOTE: There is a newer second edition, 978-0321773265 (published in 2011)

    http://office.microsoft.com/en-us/w...etters-and-documents-in-word-HA001056510.aspx

    http://www.magazinedesigning.com/drop-caps-and-initial-letters/

    https://forums.createspace.com/en/community/docs/DOC-1811


    (2) What level of kerning do you support? I was looking but I only see there is turn kerning on and off and just wondering about the specifics.
     
  37. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    That looks like something that I could add support for.

    Right now you can import kerning pairs at Font Asset creation time or add you own kerning pairs as you need them. Here is a link to the TextMesh Pro User Forum where you will find a video on adding and adjusting kerning.
     
  38. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks. The video on kerning is very good. It is nice to have that manual level of control on kerning.
     
  39. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You pretty much need that control given how much flexibility TextMeshPro gives you over the styling of the font like outline, dilation, glow which all affect the size of the characters and thus it is best when you manually adjust it to your liking.
     
    Last edited: Jun 23, 2014
  40. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks.

    Do you support small caps?

    book: The Complete Manual of Typography, (first edition was published in 2003) (see pages 197-198)
    ISBN: 0-321-12730-7
    (NOTE: There is a newer second edition, 978-0321773265 (published in 2011)

    http://en.wikipedia.org/wiki/Small_caps

    This CJK blog (author of the book I mentioned previously and I will list again here) you might find interesting.
    CJKV Information Processing, 2nd Edition
    Print ISBN: 978-0-596-51447-1

    http://blogs.adobe.com/CCJKType/
     
    Last edited: Jun 24, 2014
  41. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Not at this time but I will take a look at it.

    Thanks for the reference again.
     
  42. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This tool can do some amazing things but you can do something like this example from PostScript. (See the attached PDF).
     

    Attached Files:

  43. sschaem

    sschaem

    Joined:
    Feb 14, 2014
    Posts:
    148
    The way this is rendered is via scale & blending of N layers.
    So yes, you can fully emulate this look via script in the same way its done in postscript.
    (I think this use like 80+? instance of the text)

    My hope is to expand Textmesh Pro at some point to fully support volumetric text (efficiently...)

    Here are some current render test, (Jokerman font)

    jk.jpg
    Extrusion sample (dx9 shader, Unity free)
    extruded.jpg

    Density view
    dens4.jpg

    Material & extrusion deformation
    (Properties can be animated at no cost, since the geometry is created in the fragment shader)
    filling.jpg
     
    Last edited: Jun 24, 2014
  44. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Sounds great.

    I was just going through the book (Learning PostScript: A Visual Approach, ISBN 0-938151-12-6) to see how many text examples I could do with this tool.
     
  45. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is an example of how to add Glow to some text.

     
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I really like the "template" option that you can apply "glow feature" to other text later on.

    How does the Drop Caps that I mentioned in one my previous posts fit into your current roadmap?
     
  47. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I plan on looking into it once I am back in town early next week.
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Having the ability to copy / paste material settings from one font / preset to another is super nice. Even the reset option is nice to quickly reset a material to its default settings but without whipping the SDF specific data.
     
  49. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I forgot to mention that most of the material properties like Glow Power for instance can be animated via scripts.
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is an example of the "_GlowPower" material property animated via a script.



    You can also see an example of this in the Surface Shader Web Demo in my signature.
     
Thread Status:
Not open for further replies.