Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

What are my options for high quality text outlines in Unity 5

Discussion in 'UGUI & TextMesh Pro' started by Formic, Mar 25, 2015.

  1. Formic

    Formic

    Joined:
    Aug 23, 2013
    Posts:
    4
    Hey, I'm looking to get some nice outline's around my text. We are using Unity 5 and all of our UI is using the UI system from 4.6. The Outline component that was introduced with 4.6 just doesn't cut it. I need something that will work well with the Best Fit text mode, however. I'm open to purchasing a plugin if there are any that are integrated with 4.6. Is this something I can pull off with the shader system in Unity 5? (I started looking into using the Strumpy shader but it doesn't seem to work with Unity 5 very well)

    I'm at a loss for what plugins I can use or what I can write to best accomplish this. Any insights?

    Thanks!

    P.S. As an example, I'd like to be able to get close to this effect
    43236-capture.png
     
    Last edited: Mar 25, 2015
  2. crushhh

    crushhh

    Joined:
    Mar 22, 2015
    Posts:
    12
    I'm wondering the same thing! I've actually started looking into NoesisGUI because the Unity5 UI just leaves me wanting in so many areas. Nothing is crisp. There's no vector support. The 9-slice sprites don't maintain crispness when scaled.

    It just leaves a lot to be desired in a lot of ways. The Outline and Shadow components are just horrendous looking.

    Maybe I'm just doing it wrong - but so far I'm very disappointed - especially with the no vector support.

    ---

    *EDIT*

    I found this project which is contributed to by @SimonDarksideJ
    http://forum.unity3d.com/threads/unity-ui-extensions-collection-v1-0-0-1-released.295930/
    https://bitbucket.org/ddreaper/unity-ui-extensions

    I noticed it has a couple of improved outline effects. I haven't tried them and don't know if they work with Unity5, but sounds promising.
     
    Last edited: Mar 25, 2015
    Formic likes this.
  3. Formic

    Formic

    Joined:
    Aug 23, 2013
    Posts:
    4
    I've used both of the outline scripts. They are using methods similar to the outline and shadow components provided with 4.6. Neither are much of an improvement, and I couldn't get NicerOutline to build with IOS with Unity 5.
     
  4. crushhh

    crushhh

    Joined:
    Mar 22, 2015
    Posts:
    12
    That's a bummer...

    PS. Would it be possible for you to fix the image link in your original post (it's showing up as a broken link)!
     
  5. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    Stephan-B likes this.
  6. Formic

    Formic

    Joined:
    Aug 23, 2013
    Posts:
    4
    Does that play well with 4.6? My game has tons and tons of text, and I'd really rather not port all of it over having already moved it over to 4.6. :/

    Edit*

    It looks like it does!

     
    Last edited: Mar 25, 2015
  7. crushhh

    crushhh

    Joined:
    Mar 22, 2015
    Posts:
    12
    That looks nice, but I wonder how it does performance wise in a scenario where there is a lot of text on the screen?
     
  8. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is an example of the dynamic changes that can be made to text in TextMesh Pro. This is a GIF animation showing a UI.Text object using an Outline and Shadow Effect component vs. dynamically adding an outline and shadow to a TextMesh Pro Text object.



    Note that these visual styles are achieved by tweaking material properties. This means that only one font asset is used for any point size and resolution. From there you can then create virtually an unlimited number of material presets to achieve different visual styles.







    TextMesh Pro performs equal or better than Unity's text components. If you have something in mind that you would like to see, I would be more than happy to provide an example.

    TextMesh Pro is more than just pretty text with outlines, shadows, bevel, glow, etc. It also provides greatly enhanced control over text like character, line and paragraph spacing, kerning, a lot rich text tags and better even alignment control within the same block of text. Here are a few examples.


    Notice how this is a single text object with different alignment. This is done by using the <align=xx> like <align=center> for the title.

    Here are examples of some of the additional rich text tag available in Text Mesh Pro.




    Here is an example showing how these tags can even be used with the auto layout components, ScrollRect and UI Mask in Unity 4.6.


    Lastly, you can also mix graphics inline with the text as shown in this last example.


    Let me know if you need to know anything else about TextMesh Pro.

    Important Note: The latest beta releases of Text Mesh Pro are available to all registered users of the product on the Text Mesh Pro User Forum. This release include new features as well as support for Unity 4.6 and Unity 5.0.
     
    Formic and SimonDarksideJ like this.
  9. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,685
    Interesting, what was your issue with that script in U5? Could you possibly log it on the bitbucket and I'll see about getting it improved.
     
  10. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    What about the drawcalls? Is the same as the Unity Text?
     
  11. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro follows the same 1 draw call per material rule in Unity. Multiple text objects sharing the same material will benefit from dynamic batching.

    All examples shown above use a single material and thus 1 draw call. The only exception is the example with Inline Graphics where the Sprites are using their own material. So that example is 2 draw call because we have two material used. One for the Text and one for the Sprites.

    All dynamic styling effects like Dilation, Outline, Shadow, Bevel, Glow, etc are all material properties which can be changed dynamically.

    As mentioned in my previous post, a single Font Asset per font (TrueType / OpenType) is used to render the text at any point size and resolution. Combined with different materials (presets) would can virtually get an unlimited number of visual styles / treatments for that font.
     
    Last edited: Mar 27, 2015
    badawe likes this.
  12. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    But the problem with the Sprites bellow fonts continue right? If you had something like this:

    Text
    Sprite
    Text
    Sprite
    Text

    The result will be 6 drawcalls?
     
  13. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    No. In TextMesh Pro that example is 2 draw calls. 1 for the text which is using the same Font Asset (a material) and the sprites which are using a Sprite Asset (material).

    The example below is 4 draw calls although we are using 3 different text objects. The top and middle text object use the same Font Asset and material so that is 1 draw call. The top and bottom text objects use the same Sprite Asset and material so that is +1 draw call. The middle text object uses a different Sprite Asset so +1 draw call and lastly the bottom text object uses a different Font Asset and material so +1 draw call for a total of 4. This example shows how objects which share the same materials benefit from batching and draw call reduction.

     
  14. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Since the original topic was about Outline options. Here is a comparison of UI.Text and TextMesh Pro using Arial.

    As you can see in the image below, UI Text stamps the letter 4 times with some transparency to create the outline. By contrast, the outline of in TextMesh Pro nicely follows the contour of the letter which is another benefit of its Signed Distance Field text rendering.


    P.S. The small caption text is also done with TextMesh Pro.
     
    Last edited: Mar 29, 2015
  15. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    I've made the purchase, and look really good, but one thing that I'm counting, is that this new text object will work with the new Unity UI, but looks like do not have some real integration right? You need to make a lot of adjustments to make this work with your current UI, or I'm missing something?
     
  16. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The latest beta release of TextMesh Pro are available on the TextMesh Pro User Forum. These releases include additional features as well as support for Unity 4.6 as well as Unity 5.0.

    These releases are located in the "TMPro - Alpha & Beta Releases" section of the forum.
     
  17. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The hippo says "Get TextMesh Pro".

    It's the best.
     
    Stephan-B likes this.
  18. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    Great, created an account and waiting for the approval :)
     
  19. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Approved and all good to go :)
     
  20. rainboww

    rainboww

    Joined:
    Jan 5, 2017
    Posts:
    125
    Textmesh pro is not free it actually costs 95$ and for no profit games might be no choice, any free alternatives?
     
  21. TheWanderingBen

    TheWanderingBen

    Joined:
    Nov 3, 2015
    Posts:
    97
    I haven't seen any free alternatives, but, since this is an old thread, I thought I'd give another +1 to TextMesh Pro. In my text-heavy game, no complaints at all! I'm even doing some strange things with letter rotation that I didn't think about before TMP:

     
  22. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    I recently bought SmartEdge and with the MSDF fonts, it gives greater clarity at small font sizes. It also comes with a lot of text effects, including outlines with lots of options. While also not free, it's a bit cheaper, and I highly recommend it. It's nice to have several great text assets to choose from now.
     
    Inter-Illusion likes this.
  23. rainboww

    rainboww

    Joined:
    Jan 5, 2017
    Posts:
    125
    Well no textured texts for me than. I dont work too much with text the idea was just to give the menu items some extra fancyness.