TextMesh Pro - Advanced Text Rendering for Unity - Beta now available in Asset Store

Thanks for your amazing quick answer !

Good news !!

I prefer to keep the asset sore version, to just see the “update” button when a new update is available, it’s easier for me

I just need to change this function ?

There are a few functions that need to be changed to make it work with Unity 5.2. If I recall correctly…

// In the TextMeshProUGUI.cs
// Needs to be added for the new masking interface change
public void RecalculateMasking()
{

}

// OnFillVBO has been replaced so this one can be commented out
//protected override void OnFillVBO(List<UIVertex> vbo)
//{
//    base.OnFillVBO(vbo);
//}

//In MaterialManager.cs
// Change from
 if (m_maskComponents[i].MaskEnabled())

// to 
 if (m_maskComponents[i].enabled)

It’s perfect, thanks.

Just a question :

When I put on a game object a Canvas, and I had a textMesh as child… when I’m moving the sprite the text doesn’t follow my sprite… (Unity 5.2)

Thanks !

Let’s move the conversation over to the TextMesh Pro User Forum and in the thread for the Unity 5.2 beta.

Please post an image of the scene setup to help me understand the scene hierarchy since I am not sure where the sprite comes from in your example.

1 Like

ok will do.

thanks for your help

hi,
I see there have been requests for things like “word doc say rtf xml or docx format”. Here is a similar, but doable (I think), request. I’d like (re)flowable text. In other words I’m suggesting something like a simplified html, including image tags (except html was originally designed to be presentation agnostic… I think separating presentation from content here would just make things more complicated). (I’m aware of the tag… it’s only for inline images?). You may have already implemented it but I can’t see anything that suggests this is so.

The idea is you provide a container and layout elements and the text fills the remaining space. At that point you can make a simplified html language with drop caps, images aligned to corners etc where the text naturally flows around the image See the python library reportlab for an example (with code), or latex. I have implemented a simple one of these before. The process is basically layout things that are spaced absolutely then use a line wrapping algorithm to break the text that flows in the remaining spaces (which you must know as you’ve implemented one already). Iirc I had to build a tree of objects and walked the nodes once bottom-up to determine their preferred size and then again top down to dish out the positions/sizes they actually get.

The use case is help systems for games. I think there’s no good current solution for laying out a good help system automatically from xml (as opposed to manually laying out each page… which becomes problematic when it comes to internationalization).

Adding the ability to have text flow around objects is certainly a feature that I would love to incorporate at some point.

One of the big challenge with the more advanced forms of text layout is performance and fending off the garbage collector. A lot of applications that do these types of things (like MS Word or InDesign, etc…) are certainly fast enough to keep up with human input but are horribly slow and not designed to deliver the type of performance people expect in game development. When people use Word or InDesign, they are incredibly tolerant in terms of performance. For instance no one seems to be bothered by the screen re-drawing when you re-size a text container or change margin in those applications. However, in the context of games, text is expected to be blazing fast because “it’s just text”. Who wants to spend CPU cycles on text? Most want the CPU and GPU to be used for AI or particles or fancy stuff. Ie. Text is sort of taken for granted.

I really want to keep pushing the envelop and add to TextMesh Pro those types of advanced forms of text layout, support for ligatures, RTL languages, etc. The challenge is to figure out a super efficient way of doing it. I so wish I could find white papers on Ultra fast and efficient text layout systems. When I was working on the signed distance field part of things, I found like 20 white papers on crazy and efficient ways to compute signed distance field but when it comes to text…I haven’t had much luck.

Hello,
Is it possible to create an internal bevel like on this picture?

It is possible but I can’t find one of the recent examples I had made. The following link contains some examples but I’ll try to find the better one that looks very similar to your example. Since it is almost 5:00 am for me, I’ll post the better example tomorrow when I wake up.

ok, thanks very much! I will be wait

Here is one of those images.

2280299--153096--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.

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.

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.

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.

Can you describe how achieve such result? With any fonts.

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.

font
can you tell me please what properties you are set

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.

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

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

Here is another completely different example.

OK, thanks very much

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