A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Works In Progress' started by Stephan-B, Feb 11, 2014.
@Stephan B ok, thanks.
Not at the present time. I know we can import the xml into Unity. I don't think the other two formats can be imported. I'll take a look at see.
Thanks for the reply. I really only need one to work so if xml does than that will do it for me. I was concerned not only with it pulling the data but being able to display the formatting and any pictures correctly.
This is a pretty complex thing to support. I'll take a look over the next few days and let you know what I find.
I added a new TMP_Settings file where users will be able to define the Default Font Asset that should be used when a new text object is created. This settings file also allows specifying which Style Sheet should be used by the text objects.
Additional settings could be added over time to this file.
At the request of a few users, I added a new tag: <noparse> </noparse> in TextMesh Pro.
This results in text enclosed within those tags not getting parsed. So for instance "This is an <noparse><u>example</u>.</noparse>" will show "This is an <u>example</u>."
I also added support for typing Unicode characters in the Text Input Box using UTF-16 \u00EF format. This can be very useful when trying to access special characters / glyphs in a font asset like Font Awesome for instance.
Hi, I just purchased this plugin and when I imported to my project, how come example #10 and #11 are not imported?
My project is using Unity 4.6.4f1
Is Inline Graphics & Sprite support is only limited for Unity 5?
Apparently, the User Guide .pdf I have mentioned that the build is BETA 0.1.40, but the Release note on Asset Store says that the version available for Unity 4.6 is 0.1.46 Beta 5
I tried to open my Asset Store window again and click the import button, but it's not adding any relevant feature.
The latest release of TextMesh Pro for Unity 5 is on the Asset Store. However, the latest release for Unity 4.6 is available on the TextMesh Pro User Forum. Please visit the TextMesh Pro User Forum to Register where once approved, you'll be able to get the latest release for Unity 4.6.
In terms of the Sprite feature, it works in Unity 4.6 as well but is only available with the Canvas System. I am currently working on adding support for sprites when using the normal TextMesh Pro Component which works with the Mesh Renderer. However, at the same time I am adding support to mix different fonts and materials per text objects (to both text components).
P.S. Sorry about the delay in response, I have ben driving across the U.S. to help my daughter move to college and I can't always get to the internet in a timely fashion.
Thanks for the reply,
So 0.1.46 BETA 5 for Unity 4.6 only available via TextMesh Pro User Forum?
I thought that there's some kind of error in my Asset Store, because while the package content displayed there's example scene #10 and #11, I seem unable to fetch it.
Correct. The release for Unity 4.6 is only available on the user forum.
TMPro seems great and we're liking it a lot (writing here because I haven't been approved on the forums yet).
But we're currently trying to find a font with character support for all our languages (one language at a time, not all of them at once looking at you CJK).
Anyway, when the Font Asset Creator makes generates a font asset, it does tell you how many characters it fitted on the screen, which is great, if all characters are in the font, but when dealing with CJK languages and localized files, (using character from file generation), I just have no way to verify that all characters actually exist in the font. The way I became aware of the issue is by trying to use a font for my korean localization, that only supported Chinese letters, so it basically just created an asset with some normal 12435658 and asdsfgdsheyrtv letter + character in them that were in the txt file as well, and no korean letters. However the status of the generator is 549/549 chars rendered. I'm thinking there must be a way for your renderCharacter function to check if the character it found and inserted had a size of zero or something. and report it as a missing character.
Edit: link to my support request on the forums:
I just approved your registration to the TMP User Forum.
In terms of your question related to detecting missing characters, let me see what I can come up with in this regard.
As per the request of a few users, I modified the Font Asset Creator to include a report characters that could not be packed or missing from the font file.
I'm trying to make my text bend on a curve (circle, basically). I read that you've made something similar (animation on a curve) here. However, I couldn't find the AnimationCurve script. Is the feature removed?
Here is a link to the thread on the TextMesh Pro user forum which includes the script that was used to create similar FX.
Look for the VertexAttributeModifier.cs script which should be used to learn how to access / use the textInfo class to implement similar functionality.
Hello Stephan. Are you add <spite=...> tag for TextMeshPro objects (not child of Canvas) in new version?
That is my current focus which also combines the ability to mix different fonts and materials per text objects.
Did an initial pass at adding RTL language support in TextMesh Pro a few weeks ago. However, I am going to need some user feedback and help given I cannot read a single RTL language.
Please see the following thread on the TMP user forum.
New Release of TextMesh Pro for Unity 5
Release 0.1.5 Beta 2.2 of TextMesh Pro for Unity 5 has been released! It is currently available on the TMP User Forum and should be available on the Unity Asset Store by the weekend (unless some major issue is reported).
TextMeshPro 0.1.5 Beta 2.2 Release Notes
Please carefully review the release notes before upgrading and always backup your project beforehand. These notes reflect the changes between release 0.1.5 Beta 2 and this new release 0.1.5 Beta 2.2.
Important Upgrade Note about Rich Text Tag Changes This new release brings about significant changes to many rich text tags to increase their functionality by supporting tag values to be specified in Pixel Units (px), Font Unity (em) or as Percentage (%). As a result of this change you will most likely need to update your existing text objects and tags to use the updated format and values. For instance, the previous <size=%125> tag will need to be changed to <size=125%>. Tags that are not properly formatted will show up as text and won't be processed to make it easier to identify the tags that need to be corrected.
Important Note for Windows Users related to the Font Asset Creator: If you are NOT using Visual Studio, you will need to install the Visual C++ Redistributable Packages for Visual Studio 2013. Please download and install "vcredist_x64.exe". These dll's are required by the Font Asset Creator and sadly no longer included in Unity 5.0.
Important Note about Asset Importing Since Unity's Asset Importer does not have the ability to manage or remove files which are no longer needed, it is best to delete the previous "TextMesh Pro" folder / installation before importing the newer release. As long user created content such as Font Assets, Material Preset, Sprite Assets or any other user created files are not saved inside the TextMesh Pro folder hierarchy, this method of importing new packages will work best.
Minor Note When importing this new package, you will get about 18 warnings (1 per material) related to the Material Editor. These are harmless and will only appear the first time the package is imported. This is a confirmed Unity bug which will be fixed in 5.2 or sooner according to Unity.
Added new TMP_Settings file which allows users to define the Default Font Asset, Default Sprite Asset to be utilized as well as the Default Style Sheet.
Add support for non-breaking space (char 160)
Add new property to prevent characters like \n \t \r from being parsed.
Bold spacing can now be adjusted per font in the Font Asset editor.
Add the ability to reference Sprites by name as well as rename sprites in the Sprite Asset editor.
Added the ability to type UTF-16 Unicode characters in the Text Input Box. The format is "\u00FF"
Added <noparse> and </noparse> tag which prevents text parsing within the tags.
The Font Asset Creator will now report which characters were missing or unable to be packed in the Font Asset.
Fixes & Improvements
Improved compatibility with Canvas Group Raycasting.
Revised the GetSimpleHashcode function to reduce the likelihood of collisions.
Fixed an issue related to selecting mutliple objects of different types.
Removed extra padding on sprite characters in the text object as it was unnecessary.
Revised how padding is used in conjunction with Dilation, Outline and other material properties which affect the bounds of each character.
Added 32 bit plugin and revised folder hierarchy to add 64 bit plugin into its own folder.
Revised how Event registration is handled which greatly lessens the allocations when lots of text objects are being used.
Fixed an error that would occur when saving a font asset just after it was already saved.
Fixed an issue where BaselineJustified wasn't being applied properly.
Fixed minor cosmetic issue with Auto sizing editor panel.
Improved how material inspector visibility is handled.
Add a warning in the material inspector when a new material is assigned where it doesn't match the font atlas of the Font Asset.
Revised how Strikethrough is handle when using Smallcaps.
Improved line spacing when using different point sizes.
Revised the FontStyle enum to accommodate more styles. New format is m_TextMeshPro.fontStyle = FontStyles.Bold | FontStyles.Italic to combine styles.
Improved handling of lowercase, uppercase and smallcaps in terms of character substitutions with international languages.
Improved handling of monospacing.
Please be sure to report any issues related to this release in this thread which makes it much easier for me to track.
NOTE I - Unless major issues are uncovered in this release, I'll be focusing (mostly) on getting support for mixing different font assets & materials per text object in the next release as well as support for Unity 5.2.
NOTE II - Once it appears this release is stables, I'll be updating the Unity 5 release of TextMesh Pro available on the Unity Asset Store to this version.
NOTE III - There is also an experimental / work in progress try at RTL support with the Normal TMP Component but I need user feedback on this since I can't read any RTL languages.
Work-In-Progress - Mixing different fonts and materials per text object in TextMesh Pro with the <font="font asset" material="material name"> tag.
There is still much work to be done before this feature is released but "it is breathing now"
Here is an example using 8 different fonts & materials. This is using the same script as example 11 - Old Computer Terminal that is included with TextMeshPro. I duplicated the object to show one selected.
It seems that most fonts match each other in terms of alignment and scale. However, there are some where the font designer (I guess) didn't keep that in mind. As a result, I'll be adding a scale property to the Font Asset inspector to allow adjusting fonts like "Arcade.ttf" which is used by the word "of" which is too small.
This is still work-in-progress but it is taking shape
Currently working to make sure Dynamic Text Styling (Dilation, Outline, Shadow, Glow, etc.) works well with the Multi Font & Material support in TextMesh Pro.
This example uses 4 different fonts which have different settings in terms of outline and shadow.
Here is another update for tonight.
As I was working with multiple fonts, it became apparent that I needed to re-work how line spacing is handled. The previous implementation was using fontScale to handle line spacing adjustments steaming for the use of the <size> tag for instance. This worked fine but when using multiple fonts which happen to have been created using different sampling / point size thus resulting in different fontScale for each, the previous implementation didn't work so well.
Interestingly, the revised implementation which works perfectly with multiple fonts turned out to be simpler and more efficient than the previous one.
First, this example is using 5 different fonts (one for each letter). I am using the (same unmodified) TMP_TextInfoDebugTool script which is included in the latest release of TextMeshPro to help me visualize the individual characters as well as the Ascender and Descender of each font (in this case represented by a single character). The cyan lines show the Ascender and Descender of each font / character. So instead of using fontScale, I am now using the Ascender and Descender of each character / fonts which takes into consideration the point size / scale anyway.
As you can see in this GIF animation, word wrapping behaves as expected. You can also see how the lowest Descender of a line and tallest Ascender of the next line determines the line spacing. You see when I adjust the Descender of the first line how it affects the next line and how adjusting the Ascender of the second line also affects the line spacing.
Once I have a chance, I'll create a video going over all of this. Creating a video will give me an opportunity to further test all of this.
We're just testing Unity 5.2 RC1 as it has a bug fix we need, and TMP inline sprite sizing is broken. I remember seeing a post about broken backward compatibility and canvas verts in the beta forum a while back. Was this resolved? Do we need to make any changes or grab an update? We're currently running on Unity 5.1.1.
We tried TMP 0.1.5 Beta 2.2 but apparently it's not currently supported in 5.2. However, the older beta that we're on (unfortunately I don't know the version, but it's recent) seems to mostly work.
Here's an image link (see tooltip center top)
I just installed Unity 5.2 RC1 and imported Release 0.1.5 Beta 2.2 of TMP and after making a few minor changes (related to API changes on Unity's part) everything appears to be working.
I have made available this revised release on the TextMesh Pro User Forum. Registered users of the forum can access this release here.
Give this new package a try and then let's figure out why the sprites aren't scaling correctly. Please provide feedback in the release thread on the TMP user forum.
Here is a test of cycling thru 6 different fonts in a text object. Notice how line spacing and word wrapping behaves as expected.
Thus far this new feature is coming along pretty well. Still lots more work to be done but I am pleased so far
Multi Font & Material Support Preview
The following video is a preview of the new Multi Font & Material support coming to TextMesh Pro. This is still Work-In-Progress but it is coming along very well.
Hi Stephan! Your asset very intresting. I think that I buy it, when it's will support input field like functionality. But I have one question. Your text mesh links (or another interracting with text) providing some callbacks (something like OnHover(int linkHash)) or we must do all by hand (get on enter and on exit callbacks, search intersections etc)?
P.S. English its my "readonly" language...
If you watch the following video about the link support, it covers the TMP.TextUtilities.cs class which contains several functions like those below which will return the index of a character, word, line or links intersecting or nearest to some position.
public static int FindIntersectingCharacter(TextMeshProUGUI text, Vector3 position, Camera camera, bool visibleOnly)
public static int FindIntersectingWord(TextMeshProUGUI text, Vector3 position, Camera camera)
public static int FindNearestLink(TextMeshProUGUI text, Vector3 position, Camera camera)
These functions use the information contained in the TextInfo class which contains information about every character, word, line, link, and the geometry of the text object. Here is a link to another video which may provide additional useful information.
Using these functions makes it easy to implement your own system where you could use Unity's event system or your own. Here is an example where the vertex color of a character would be change when the mouse is over it.
// Check if Mouse Intersects any of the characters. If so, assign a random color.
int charIndex = TMP_TextUtilities.FindIntersectingCharacter(m_TextMeshPro, Input.mousePosition, m_Camera, true);
if (charIndex != -1 && charIndex != m_lastIndex)
m_lastIndex = charIndex;
Color32 c = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
int vertexIndex = m_TextMeshPro.textInfo.characterInfo[charIndex].vertexIndex;
UIVertex uiVertices = m_TextMeshPro.textInfo.meshInfo.uiVertices;
uiVertices[vertexIndex + 0].color = c;
uiVertices[vertexIndex + 1].color = c;
uiVertices[vertexIndex + 2].color = c;
uiVertices[vertexIndex + 3].color = c;
if (m_TextMeshPro.textInfo.characterInfo[charIndex].type == TMP_CharacterType.Character)
else if (m_TextMeshPro.textInfo.characterInfo[charIndex].type == TMP_CharacterType.Sprite)
The only real relevant line of code above the is FindIntersectingCharacter(), the rest simply deals with what we want to do if we have an intersection.
The latest release of TextMesh Pro includes the scripts used in the first video that I linked above.
Hopefully, this helps you get a better understanding of how it works.
In terms of the Text Input Field, that is next on my list of things to get done before Unite in Boston.
BTW: The Text Input Field will rely heavily on those TMP_TextUtilities functions. Using those someone could easily implement their own text input field for TextMesh Pro.
I understand, you do not provide any callback, but provide framework to do it. Thanks for response. =)
It's getting there
Here is an example of using 3 different Font Assets along with Inline Graphics (Sprites) in a single text object.
Stephan B, I'm still a little confused. Can this be incorporated into the new Unity UI (the uGUI)? Are there screenshots of it being used in the UI itself? I'm considering purchasing this, but I'm not sure how well it does as UI text or numbers (such as health numbers or mana etc...). I'd like to see it in various UI situations (for Unity 5).
There are two TextMesh Pro Components available. One which replaces the TextMesh and GUI Text Components used with the Mesh Renderer and the other (the TextMeshPro UGUI) component which replaces Ui.Text.
See the following video which shows how to create new text object for either renderer.
Multi Font & Material + Sprites
Decided to test the Reveal script that I used a while back. This is a single text object which contains 4 fonts and sprites.
Although this text objects uses multiple fonts and sprites, the layout of the text is independent of those things and thus in this implementation, rich text tags, text formatting, word wrapping and all other features of TextMesh Pro are still available.
I am not done with the implementation of these new capabilities but it is getting there.
P.S. I wish GIF compression wasn't so bad but you get the idea
Had a question about the Page option under Wrapping & Overflow. Is there a way to determine the number of pages? Ideally I'd like to know when to stop incrementing the page number when the player hits the final page as well as have the page count for display on the UI (like "Page 3 of 5").
TextMeshPro.textInfo.pageCount; should contain the number of pages.
As requested, I added support for UTF 32. In the next release, you will be able to create Font Assets that contains glyph / icons in the UTF 32 range.
You will be able to access these by using the uppercase U as follows "\U0001F3A3" in the Text Input Box. Via scripting, C# already supports this format so string s = "\U0001F3A3"; will work. See the example below.
In this example you can also see that I am using the new font tag to use a different font for the text since this Font Asset containing icons like the fish didn't include any letters.
P.S. Again, you can now access UTF-16 glyphs by using \u00AE (lowercase u) and UTF-32 by using \U0001F3A3 (uppercase U). This works in the Text Input Box as well as in strings.
Your asset doesn't work with Unity 5.2. How can I fix it ?
There is an early beta available on the TextMesh Pro user forum.
As to why it doesn't work out of the box, well Unity made renamed several functions and callbacks as well as making obsolete the previous way of handling geometry through the Canvas system.
P.S. The early beta on the user forum is just to make sure it works until I release the real Unity 5.2 version which will be using the Mesh class instead of the UiVertex and previous methods used in Unity 4.6 thru Unity 5.1. This new release will also include support for Multiple Fonts & Materials so it is a big change.
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)
// Change from
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)
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.
ok will do.
thanks for your help
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 <sprite> 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.
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