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

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
2037836--132084--43236-capture.png

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

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.

1 Like

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.

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)!

You should take a look at Text Mesh Pro

1 Like

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. :confused:

Edit*

It looks like it does!

https://www.youtube.com/watch?v=C6RHhkLfAmQ

That looks nice, but I wonder how it does performance wise in a scenario where there is a lot of text on the screen?

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.

2 Likes

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.

What about the drawcalls? Is the same as the Unity Text?

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.

1 Like

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?

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.

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.

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?

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.

The hippo says “Get TextMesh Pro”.

It’s the best.

1 Like

Great, created an account and waiting for the approval :slight_smile:

Approved and all good to go :slight_smile:

Textmesh pro is not free it actually costs 95$ and for no profit games might be no choice, any free alternatives?