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. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is one of those images.

    TextMesh Pro - Chiseled Text.JPG

    I still need to find the larger size one (argh)

    P.S. If you can link the font you are using I can create a better example tomorrow.
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a preview of added support for the new 2D RectMask that will be available in Unity 5.2.

    Please note that both Hard & Soft Masking is supported in TextMesh Pro with the 2D RectMask.

     
  3. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I finally got around to displaying "Page X of Y" and textInfo.pageCount seems to be incorrect. It's always one less than it should be.

    On my first test, I had five pages, but pageCount was four (the page numbers were 0-4, but that's five pages). I tried a second test with half a page of text and got a pageCount value of zero.
     
  4. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Which version of TextMesh Pro and Unity are you using and while TextMesh Pro component?

    EDIT - I just checked in release 0.1.5 Beta 2.2 and the page count appears to be correct. I know there was an issue with the page count about 2 releases ago.
     
    Last edited: Sep 5, 2015
  5. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    Can you describe how achieve such result? With any fonts.
     
  6. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Given that each font is different in terms of style / shape, you'll have to play wit the values to get the specific look you desire.

    This was done by setting Underlay type to Inner. Here is an image of the material settings that I used for that particular font asset. Note that transparency on the face is important otherwise it occludes the results.



    If you give me a link to the font you are using I can create something similar.
     
  7. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    font
    can you tell me please what properties you are set
     
  8. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The new font you linked is very different than the one from the image. It has much sharper transitions and corners. The challenge here is there is an almost infinite number of tweaks that can be done. Here is an example along with the material settings I used.

    upload_2015-9-5_14-17-21.png

    upload_2015-9-5_14-17-35.png

    Here is another completely different example.
     
    Last edited: Sep 5, 2015
  9. awejk

    awejk

    Joined:
    Oct 13, 2012
    Posts:
    32
    OK, thanks very much
     
  10. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    I am getting:
    "NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.UI.MaskUtilities.GetStencilDepth "

    After installing 5.2 and following your suggested updates.

    (yes, I am using masking).
     
    Last edited: Sep 8, 2015
  11. ejtrowbridge

    ejtrowbridge

    Joined:
    May 16, 2014
    Posts:
    7
    Getting an error too after updating to 5.2:

    "Assets/TextMesh Pro/Scripts/MaterialManager.cs(265,41): error CS0619: `UnityEngine.UI.Mask.MaskEnabled()' is obsolete: `use Mask.enabled instead'"
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    @GuyTidhar @ejtrowbridge

    In Unity 5.2, Unity renamed several methods and made significant changes to how geometry is created and submitted to the Canvas Renderer. The changes that Unity made are not backwards compatible with previous versions of Unity and thus will require a specific version of TextMesh Pro to address these changes.

    I already released several weeks ago an early beta for Unity 5.2. It is available on the TextMesh Pro User Forum in the "TMPro - Alpha & Beta Releases" section of the user forum.

    I will also be releasing an updated version later today.
     
    ejtrowbridge likes this.
  13. Democide

    Democide

    Joined:
    Jan 29, 2013
    Posts:
    315
    A quick question which I also asked on twitter: Is it possible to specify which fonts to use for Bold and/or Italic? For example I have a given .ttf file in regular, bold and italic. Unity sometimes does this right by default, but only on some platforms. In other cases it uses the base font and then does it's own mojo to create bold and italic versions, which are of course not as good as the font file ones. Does TextMeshPro make this possible?
     
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Bold is created dynamically by adding a Storke (Dilation) around the edge of a character. The amount of bold (dilation) can be controlled per font including how much extra spacing bold is added. Having the ability to dynamically stroke the font does produce a nicer looking bold type compared to Unity who tends to simply stretch the characters to simulate bold.

    Italic is also added dynamically by shearing the character. The amount of shearing can also be controlled per font in the Font Asset editor / inspector panel.

    The ability to dynamically style the visual appearance of the font goes beyond just adding a stroke to embolden the font. Here is GIF animation showing how you add dilation, outline, shadow, bevel and glow to any given font asset. From there you can create material presets to recall apply those setting to any other text object using this font.




    I am currently working on adding the ability to use different fonts & materials per text object (along with Sprites) which will then allow you to switch to a designed (bold or italic) version of any given font. Here is a link to a preview of this new feature.

    TextMesh Pro - Reveal Multiple Fonts & Sprites.gif

    Once the Multi Font & Material support is released, you'll be able to use true bold / italics designed fonts. However, in my opinion, the emboldened font looks close enough where 99% of people would not be able to tell the difference.

    Hopefully this answers your question. Let me know if you need any additional information.
     
  15. Democide

    Democide

    Joined:
    Jan 29, 2013
    Posts:
    315
    Thanks for the quick reply. If you're adding multi-font support, maybe can you make it so that we can simply use the <b> and <i> tags and it uses the appropriate fonts? While for bold, the settings might work to emulate the original font, it's a lot more difficult for italic. And using the b/I tags is a lot simpler than some sort of <font="X"></font> setup.
     
  16. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    In Unity 5.2, when you add a canvas and a textmeshpro as a child of a transform, when you move the transform the text doesn't follow his parent (it's not refreshing).

    Any idea ?

    Thanks!
     
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Let me take a look.
     
    ababab5 likes this.
  18. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you post an image of the scene setup that you have?

    Using Unity 5.2, I have a Canvas with an empty gameobject using a normal Transform to which a TextMeshProUGUI object is added as a child. When I move the gameobject around, the child follows as expected.
     
  19. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    I tried it, but it did not address this:
    "NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.UI.MaskUtilities.GetStencilDepth".
    Masking seems to be an issue with this version.
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This is an error on a Unity function which I am not even using in TextMesh Pro. Could another addon be calling this function?

    If you double click on that error, where does it take you? Any clue as to which function or script might be calling this?
     
    Last edited: Sep 10, 2015
  21. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    In factit' was muy fault (not sure but ...) : it was the issue with a canvas inside a canvas ... I should report a bug
     
  22. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Glad you isolated the issue. It would be a good idea to report the bug to Unity.
     
  23. Deleted User

    Deleted User

    Guest

    any eta for the input field update?
     
  24. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    I have some issue on Android with the TextMeshProUGUI (but work fine on iOS).

    Any idea ?

    Thanks a lot!

    Best regards,

    AB

    IMG_2974.png
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Unity broke something related to OpenGL ES 2.0 and 3.0 devices in Unity 5.2. Here is a thread related to this issue. I am waiting to here back from Unity and for them to fix this. http://forum.unity3d.com/threads/re...engl-devices-case-725989.353651/#post-2289139

    P.S. I also received an email from them this morning confirming this is a bug.
     
  26. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Thanks for the answer.

    But why it's better to use the UGui version (compared to the regular version) ? Just to understand...

    Thanks !
     
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Unity simply introduced a bug in Unity 5.2 on the Canvas rendering side of things. As you can see from your image, although the same set of shaders are used, it works when using the normal TextMeshPro component which uses the Mesh Renderer but does not work with using the TextMeshProUGUI component which uses the CanvasRenderer.

    BTW: This issue only happens on devices running OpenGL ES 2.0 & 3.0. Devices that can run Metal don't have this issue when using the TextMeshProUGUI component. So this is isolated to the CanvasRenderer and OpenGL ES 2.0 & 3.0.
     
  28. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Sorry my question was not clear.

    About performance, or whatever. What's the best to use ?
    (Forget this issue, if everything work fine)
    Thanks a lot again for the explanation
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Mesh Renderer offers better performance than the CanvasRenderer which has to handle additional processing. As a result of the differences between the two renderer, the normal TextMeshPro component ends up performing better.
     
    ababab5 likes this.
  30. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Ok thank you!
     
  31. prawn-star

    prawn-star

    Joined:
    Nov 21, 2012
    Posts:
    77
    Hi Stephan
    where can i find this "TMPro - Alpha & Beta Releases" section of the user forum" can you post a link.
    I updated my version today from the asset store but I still get errors
    Assets/TextMesh Pro/Scripts/TextMeshProUGUI.cs(835,18): error CS0619: `UnityEngine.UI.Graphic.OnFillVBO(System.Collections.Generic.List<UnityEngine.UIVertex>)' is obsolete: `Use OnPopulateMesh instead.'
    Assets/TextMesh Pro/Scripts/TMPro_UGUI_Private.cs(17,26): error CS0535: `TMPro.TextMeshProUGUI' does not implement interface member `UnityEngine.UI.IMaskable.RecalculateMasking()'
     
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You need to register to the TextMesh Pro user forum. Once approved, you'll have access to the latest releases which include a specific release for Unity 5.2.
     
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New release of TextMesh Pro for Unity 5.2 is available on the TextMesh Pro user forum.

    This release include a few new feature but was released to mostly address the OpenGL ES 2.0 & 3.0 rendering issue introduced in Unity 5.2.
     
    ababab5 and actraiser3 like this.
  34. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    As part of the Multi Font & Material support which I am adding in TextMesh Pro, it will now also be possible to define Font Assets to be used as Fallback in the event certain characters (glyphs) are missing from the currently assigned font asset.

    The list of Font Assets and order in which they will be searched will be defined by simply adding those Font Asset to the Fallback list in the TMP Settings file.

    Here is an example where the Impact SDF Font Asset is missing the "1/4" glyph (UTF16 Unicode) as well as an image in the UTF32 Unicode range. In this case, two different font assets are used as Fallback.

    upload_2015-9-14_0-39-58.png
     
  35. Igorexa

    Igorexa

    Joined:
    Sep 25, 2014
    Posts:
    23
    Tell please when is expected to add support for "sprite" tag in Unity 4.6 (not canvas render - for mesh renderer)?
     
  36. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This is part of the Multi Font & Material support that I am currently working on. Here is the latest example showing the use of multiple fonts and sprites using the normal Mesh Renderer.

    TextMesh Pro - Reveal Multiple Fonts & Sprites.gif
     
  37. prawn-star

    prawn-star

    Joined:
    Nov 21, 2012
    Posts:
    77
    Ok thanks

    will need to hunt around for my invoice number
     
  38. Igorexa

    Igorexa

    Joined:
    Sep 25, 2014
    Posts:
    23
    When you plan to release?
     
  39. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am hoping to have this new release available shortly after Unity in Boston. On the flip side, I also need to make sure everything is working well :)

    P.S. My biggest concern right now is the impact of the release of Unity 5.2 which appears to have higher than usual issues coming out of the gate. As a result, I am kind of stuck going along for the ride while Unity delivers the first few patches and handle whatever new issues or changes this might affect on my end of things.
     
  40. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Are there any plans for unordered/ordered list formatting? Or is it already possible?
     
  41. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You can sort of pull that off with the <indent=25px> tag. In the example below the text is
    "1.<indent=25px>This is an example...

    Give that a try and let me know if that might work or which part doesn't. Adding that type of feature doesn't seem overly complex but then again I could be surprised.

     
  42. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Thanks for the quick reply!
    I think this works. I will try and see how it plays with my localisation stuff.
     
  43. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    Using Unity 5.2 with TMP 5.2.1c

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(150,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOColor' and the best extension method overload `DG.Tweening.ShortcutExtensions43.DOColor(this UnityEngine.SpriteRenderer, UnityEngine.Color, float)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(150,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.SpriteRenderer'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(200,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOFade' and the best extension method overload `DG.Tweening.ShortcutExtensions43.DOFade(this UnityEngine.SpriteRenderer, float, float)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(200,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.SpriteRenderer'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(249,107): error CS1928: Type `TMPro.TextMeshProUGUI' does not contain a member `DOText' and the best extension method overload `DG.Tweening.ShortcutExtensions46.DOText(this UnityEngine.UI.Text, string, float, bool, DG.Tweening.ScrambleMode, string)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(249,107): error CS1929: Extension method instance type `TMPro.TextMeshProUGUI' cannot be converted to `UnityEngine.UI.Text'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(250,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOText' and the best extension method overload `DG.Tweening.ShortcutExtensions46.DOText(this UnityEngine.UI.Text, string, float, bool, DG.Tweening.ScrambleMode, string)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(250,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.UI.Text'
     
  44. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You should report those errors to the author of DOTweenPro. He seems to be very responsive so he should be able to handle that quickly.
     
  45. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    is there anything I have to do when installing both packages?
     
  46. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    no worries.. fixed now
     
  47. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Glad you got it sorted out :)

    Do you mind sharing what the issue was in case someone else runs into this or has the same question?
     
  48. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    I was supposed to go to the "tools menu" and click "Dotween Utility Panel" and then click "Setup Dotween"

    That's all.. I should've read the readme file :oops:
     
  49. NeonTanto

    NeonTanto

    Joined:
    Jun 19, 2013
    Posts:
    156
  50. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    using unity 5.2 + TMP 5.2 Beta 1c


    I'm getting alot of these errors:
    NullReferenceException: Object reference not set to an instance of an object
    TMPro.TextMeshProUGUI.OnValidate () (at Assets/TextMesh Pro/Scripts/TMPro_UGUI_Private.cs:584)
     
Thread Status:
Not open for further replies.