Text asset?

Can someone recommend me a text asset? I know people like text mesh pro but I am not sure. I just need clear not pixilated small text and decent outlines. I relay like “UITextEffect” asset but its not clear if small text is any better with it.

If any one got experiences with different text assets, please share, I am specially interested in performances differences.

There are sort of 3 common ways to get text with an outline.

The first method is to use an external font tool to create a font with an outline or photoshop. This results in some font data along with a font atlas texture which contains all the characters in this bitmap texture. Since this font atlas texture is static, if you need a different point size or need a thicker outline or an outline of a different color, you need to create another font so you end up with as many fonts / textures as you have variations. From a visual point of view, as long as the font is rendered at the point size it was created, the outline and text will look nice. From a performance point of view, each character is rendered into two triangles which is efficient. This is using a bitmap font so as you zoom in, it will get pixelated.

The second method is to use Unity’s UI.Text with the Outline and Shadow FX scripts (assuming you also want shadows). This is implemented by those scripts duplicating and stamping the current text (4 times in the case of the outline) with an offset in order to create the outline. From a visual stand point as seen below, this is not accurate.

In that image, I used an offset value of 5 and -5 in order to make it easier to see how it is done. When using a thinner outline and small font it can look ok. Since these offset values are in pixels, as you change the point size of the text, the outline gets thinner or thicker. All this might be ok however, the real issue with this technique is that it more than quadruples the geometry which results in a significant performance impact which you can see in the table below. Since this is still using a bitmap font, as you zoom in, it will get pixelated.

The third method is what TextMesh Pro does where the outlines and / or shadows are done by the shader and made possible by the use of SDF (Signed Distance Field) Font Assets which you create with the included Font Asset Creator. Unlike a bitmap font atlas texture where the pixels in the texture represent the shape of the characters, the SDF Font Atlas texture contains distance information to represent the shape of the characters. More precisely, for each pixel a distance to the nearest edge of the character is stored in this static SDF Font Atlas texture. Since the distance to the nearest edge of the characters is a constant, this text will render correctly at any point size and zoom factor and will never get pixelated. Since the outline thickness is relative to this distance, as the point size changes, the outline thickness remains proportional. See the image below of the same word at the same point size.

You can clearly see how clean the outline and soft shadow look. Unlike the first method where you need to create a new font atlas texture for each point size, thickness, color, etc… Only (1) single SDF Font Asset is required to create as many permutations as you want and for any given point size. In order to get different looks, you simply tweak the material properties and create material presets to recall those different looks. Here is an example where all I did was play with the material properties.

Now from a performance point of view, each character is still rendered into two triangles. Although the shader(s) have to do more work than plain bitmap shaders, when using outline and shadow it is marginal.

Here is a chart comparing UI.Text vs. TextMesh Pro. These tests were done in Unity 5.3.3p1 using the latest release of TextMesh Pro available on the user forum. These tests were done on an Android Galaxy Tab A. Time (ms) is that of Canvas.SendWillRenderCanvases() which is where the text is generated by both UI.Text and TextMeshProUGUI. These tests were done using the Canvas system.


Geometry count is that of text “Outline #0” or 9 visible characters. Although UI.Text + Outline + Shadow is 5X slower than TextMeshPro, the time (ms) is still small enough where the device is still hitting 60 fps.

Here are the results of a previous test done on my Desktop PC several months ago.

This is the text / rendering results for this older test.


Top text is UI.Text bottom is TextMeshPro.

I have no data on how UITextEffect compares both from a visual and performance stand point.

This information only covers the rendering and performance differences between UI.Text and TextMeshPro. TextMesh Pro offers a lot more functionality in terms of text formatting options and layout. It now includes over 36 rich text tags including support for multiple fonts and sprites per text object, font fallback, stylesheet, hyperlink support, etc…

Here is a simple example of the Multi Font & Sprites functionality which is in the latest release (again only available on the user forum at this time and soon to be released on the Asset Store).

2295424--154421--TextMesh Pro - Reveal Multiple Fonts & Sprites.gif

The reveal FX is done by using the .maxVisibleCharacters property which is a simple integer that controls how many characters should be visible. This does not involve any string operation (ie. GC free), ensures the text word wraps correctly all the time and works with all rich text tags and alignment options.

Hopefully, I provided you with information that will help you get a better idea of how TextMesh Pro compares to UI.Text and potential ways to deal with text with an outline. Should you have any questions, please feel free to ask.

11 Likes

Thanks for explaining the outline, it is very interesting, but what about blurry text?

Are you looking to blur the text or to not having it appear blurry. TextMesh Pro can do both by using the Softness control. Unless you add softness, the text will always render cleanly and sharp at all point size and zoom.

1 Like

That is what i wanted to hear. It there realy no alternative to Text Mesh Pro?

Well now you’re just making it look like Unity ui.text and its font effects was developed by an intern…

How much would Unity Technologies have to pay you to include this in Unity natively, they could really do with someone like you to add better built in improvements.

Also the font fallback support you added recently looks like the problem of multi language support is covered now, though it does look like some extra ground work is still needed to manually add extra fonts to cover those languages.

The developers at Unity are all amazing folks. It’s just that text in pretty much all game engines is an afterthought.

A lot more could be done with a closer integration. The folks at Unity know how to get a hold of me if there is any interest.

The addition of the Multi Font & Sprites support along with Font Fallback opens up a lot of possibilities not only in terms of multi language support but also the ability to use fonts with icons like Font Awesome. See the following example.

https://www.youtube.com/watch?v=0w827VBocIY

Here an example showing how the material properties can be tweaked dynamically to achieve different visual styles for the text.


GIF - Animation so please forgive the compression artifacts.

Once you are satisfied with a particular look, you can create a Material Preset using the added material context menu. Those Material Presets can then assigned it to any text objects using the same font asset.

Typically for larger text on screen like titles where the text is more heavily stylized, you end up with more presets whereas for smaller text, I usually only create a preset with an Outline and another with Outline and Soft Shadow.

some of your images are linked to some walled up google link you need to login for…

Thank you for letting me know. I have updated the images and hopefully you can see all of them now.

Been using TextMeshPro for the better part of a year now and when it comes to text, I simply could not live without it.

All the images appear fine to me.

TextMeshPro for president!

In all seriousness though, text mesh pro is miles ahead the best text asset for unity, the default tools aren’t even in the same league. The only real use case where TextMeshPro doesn’t really work at is loading fonts not built into the project.

3 Likes

Yep, TMP is easily one of my five “must have” assets.

And, as Stephan just demonstrated, the support is PHENOMINAL.

2 Likes

Awesome nickname.

Looks like i have to buy this then, dont need it right now so ill put it on my watch list for some time, maybe there will be a discount on it.

Thanks for adding TextMesh Pro to your wishlist.

In terms of pricing, the current price reflects a 30% discount since the product is still labeled as beta. Once version 1.0 is released, the 30% beta discount will go away and the new price will be between $90 and $95. The last two major remaining features on my 1.0 list were the Multi Font & Sprites which is now available and the Text Input Field which I am currently working on. Once this new feature is available, I’ll give a 30 day heads up to everyone and then finally release version 1.0.

After version 1.0 has been released, the product will go on sale from time to time but the discount and price will never go below the current $65.00 as I feel those who purchased my product when it was first released as beta and had no reviews and thus took the greatest risk deserve my gratitude and to have paid the lowest price for my product.

2 Likes

Is there an estimated time for it to come out of beta? I mostly ask because I can’t afford it until the end of the month

I am hoping to get this last remaining feature on my 1.0 list released within the next 30 to 60 days. I just need to keep resisting the urge to keep adding more features in between. :wink: So you’ll be fine thru the end of the month.

Trust me guys, 100% worth it.

1 Like

Not_Sure for Campaign Manager or at a minimum Forum Evangelist :slight_smile:

All joking aside, I keep showing all the pretty stuff but even when using plain text, TextMesh Pro provide full control over Character, Line and Paragraph spacing, Kerning. It also features over 30 rich text tags that provide much greater control over text formatting. Here’s a few of those rich text tags. See the list of tags here.

2550910--177384--TextMesh Pro - Rich Text Tag (Basic).jpg
Then you have tags like which make it possible to control alignment within a single text object.

2550910--177385--TextMesh Pro - Rich Text Tag (Align).png

2162688--142972--upload_2015-6-16_16-19-54.png

Then you have things like the <style=“style name”> tag which provides for the ability to combine these tags sort of like CSS style tags. Then you also have a tag to make it possible to embed links into your text. Here is an example where the link tag is used but also shows an example of the tag used to define a link tag.

2550910--177387--TextMesh Pro - Rich Text Tag (Style).png

Here is a video showing how you can interact with the text as well.

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

Like I said, even if all you use is plain text, TextMesh Pro provides a lot more functionality when it comes to working with text.

1 Like

You should stop usign that image service, half of those images are not showing.

Can you show how your asset renders small text on overlay canvas?