Search Unity

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

Discussion in 'Works In Progress - Archive' started by Stephan-B, Feb 11, 2014.

Thread Status:
Not open for further replies.
  1. Raimis

    Raimis

    Joined:
    Aug 27, 2014
    Posts:
    160
    Hi again, thanks for the prompt reply. On asset store it says that it's 30% off during beta prerelease, but the price shown is 65$ which i I believe is the full price, isn't it? thanks
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The price on the AssetStore is the reduce price. Once the Asset is out of Beta the normal price will be $95.00
     
  3. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I have bought from the asset store. I use Unity 4.6 and new GUI. Everything works but I have a problem: I cannot draw TextMeshPro text on Canvas/Screen Space - Overlay. Is this a limitation of the asset? Can this be done?
     
  4. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Head over to the TextMesh Pro User Forum to pickup the latest beta release with support for Unity 4.6. These beta releases are available to all registered users of the product.

    I haven't updated the Asset Store package yet as I am waiting for a few remaining items to be resolved in Unity 4.6.
     
    Last edited: Dec 19, 2014
  5. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Ok, I have registered into the forum with the invoice number. Waiting to be accepted.
     
  6. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I just approved your registration :) Enjoy the latest beta release with support for Unity 4.6.
     
  7. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
  8. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I updated to Beta Release 0.1.46 B3.3 and still I cannot see TextMeshPro text on Canvas/Screen Space - Overlay.
     
  9. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Is it a limitation or am I doing something wrong?
     
  10. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Still havent found this. Also ther eis something else need to be implemented. I think all TextMeshPro text must obey to the Canvas Group alpha. This would simplify our UI very much.
     
  11. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Sorry about the delay in response but the forums never notified me of your posts. Argh!

    There are two TextMesh Pro Components.

    The first is found in the GameObject -> 3D Object -> TextMeshPro Text. This is the normal TextMesh Pro Component which uses the Mesh Renderer.

    The second is found in the GameObject -> UI -> TextMesh Pro Text. This component is designed to work with the Canvas Renderer and is affected by Canvas Group Alpha.

    Since I did test this earlier today using this same beta, let me know if you still have any issues with this as it should be working. If it is not, please make a post on the TextMesh Pro User Forum. Be sure to include screenshots showing the inspector panel on the TextMesh Pro object as well as scene Hierarchy so I can try to reproduce whatever is going on.

    P.S. Unless I am sleeping, I typically respond within hours of posts. If I don't reply within 24 hours, assume I missed the post and feel free to PM me here or on the TextMesh Pro User Forum or even email me.
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Coming Soon! Rich Text Tag <sprite=xx>
    This new rich text tag will enable graphics to be added inline with the text. The sprite xx will reference the # of a sprite contained in a sprite sheet.



    Just like any other characters, these graphics will follow word wrapping as well as being affected by character spacing and other text layout controls. This is the first initial implementation so there is still work to be done but this feature now has a pulse :)
     
    thienhaflash likes this.
  13. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a preview of the new Sprite rich text tag which will allow to insert graphic elements inline with the text.

     
    thienhaflash likes this.
  14. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Looking really cool man :) Keep up the good work ! Most powerful Text solution so far ...
     
  15. Raimis

    Raimis

    Joined:
    Aug 27, 2014
    Posts:
    160
    Looking good! May I ask few more question? Just wanted to confirm one thing. Basically if I understand correctly the way things are rendered in text mesh pro, basically the visual output of text box with 32px text size with scale set to 1 is exactly the same as of text with 64px text size and 0.5f scale? Is that correct? Also, excuse me if I missed it somewhere, but do you have any plans on adding support for hyperlinks or otherwise active elements within texts? P.s. any estimations on when sprites feature is publicly available?
     
    Last edited: Dec 26, 2014
  16. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    That looks intriguing! So the sprites can have the same effects as the text? When do you expect this to be available?
     
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Correct. SDF Font Assets scale linearly so this 64 pts at 0.5 scale would be the same as a 32 pts at 1.0 scale.

    Yes. I haven't started working on that but it is on the list as I now have a few users requesting it.

    Not at this time but I am working on it.
     
  18. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The sprites are considered characters by the layout system so things like Character spacing, line spacing, word wrapping, rich text tags like size and indent, align will all affect the sprites as expected. On the other hand, these sprites have their own material / shader and thus Font Material properties like dilation, outline, bevel, glow, etc will only affect the characters and not the sprites.
     
  19. Raimis

    Raimis

    Joined:
    Aug 27, 2014
    Posts:
    160
    Do you think sprites feature could be released within next 2-4 weeks? We are starting a major rebuild of one of our game UIs and I'm leaning towards using textmeshpro for rendering all of the texts.
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am pretty confident I will be able to release the sprite feature within the next 4 weeks.
     
  21. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The new <sprite> tag is coming along pretty good.

    By default the height of the sprite is equal to the font ascender and vertically aligned to the baseline. However both vertical alignment and the scale of the sprite can be controlled individually.



    I still need to create a custom inspector for the Sprite Assets to make it easier to edit alignment and scale for each sprite contained in the Sprite Asset.
     
  22. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Ooh it's nice. Makes the graphic designer within cringe like hell but I'm thinking of cool things like Press (x) to continue or whatever when joypad is used. A most useful quality of developer life feature!
     
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I need to find a nice png with lots of game pad icons.



    As I said before, sprites are considered characters by the layout system so they behave as expected.

    One piece of the implementation I am uncertain about is the mapping of those characters in terms of the Unicode chart. I am thinking that all sprites should be assigned the same unicode value. So when checking characterInfo[index].character you would be able to known if this character is a sprite.

    I would also add textInfo.spriteCount which would allow a user to know how many sprites are used in the text object. A new spriteInfo[index] structure would be added to textInfo. spriteInfo[index].index which would represent which character index this sprite is at in the characterInfo[]. spriteInfo[index].vertexIndex would represent the first UIVertex of the sprite geometry so it could be accessed and modified to do stuff to it. Lastly spriteInfo[index].spriteIndex.

    Not sure if I missed anything.
     
    hippocoder likes this.
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's good stuff. But how about animation for example a gloss sheen? If this is a stretch too far perhaps it's more sane to let the developer place the sprite there - but give tools to make the space for it and obtain the coordinates for that space for example specifying our own id and width for a sprite in units, then GetSpritePosition(id) to get the xyz coordinate of the precise placement it would go... would help for people who might want animated sprites (unless you have that all worked out).

    Embedding this kind of meta data could open up the opportunity to put 3D objects in those spaces where sprites would have been and so on. I wouldn't use this but just thinking out loud.

    For me its not essential to animate them, and I would probably skip animating them without the feature (I only have so much hair left). So not essential... just thoughts.
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    By using the textInfo and sub set of structures, it is pretty easy to get information about the location of any character or soon sprite used in the text object. For instance, once you have the UIVertex index of the sprite, changing the position to create a jitter effect or changing vertex color or to animate / change the UVs to essentially have them point to a different sprite in the atlas would be simple.

    Since the textInfo.characterInfo[index] already includes information about each character such as bottom left, top right, baseline, ascender, descender using this information would make it easy to add a 3d object or collider or track mouseovers.

    Back to animating, I guess there are two ways (that I can think of). The first could be to replace <sprite=0> by <sprite=1> in the string which would work but we all dread string manipulations. Alternatively and the method I would prefer would be to animate the UV of the sprite to have them point to other sprites in the atlas. There might be a third but sadly I haven't looked deep enough into sprites and how those would be animated in Unity 4.6 using Raw Image or Image Components for instance.

    P.S. Reflecting on this, I would create a small script and track mouse position. I could use the spriteInfo or characterInfo structures to figure out which sprite the mouse is over. I would then look up which UIVertex index this sprite is using in the sprite mesh. Assuming I had a sprite sheet with X frames per sprite, I would cycle through those by changing the UVs. Just like the Vertex Attribute animation examples I posted, this would alter the mesh data after TextMesh Pro has done the layout. This is sort of post processing of the mesh created by TextMesh Pro and thus keeps it static. However, in Unity 4.6, due to how the CanvasRenderer and Canvas system works, it would trigger Unity rebuilding the Canvas.
     
    Last edited: Dec 29, 2014
    hippocoder likes this.
  26. M3NTA7

    M3NTA7

    Joined:
    Apr 2, 2013
    Posts:
    4
    Hi,

    This is probably a stupid question, but I'm new to buying Unity assets.
    I purchased TextMesh Pro and now I want to register at the Digital Native Studios forum.
    It says to enter the following:
    TextMesh Pro Purchase Invoice Number:

    Where do I find that?

    Thanks!
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    On the invoice unity always sends you when you purchase, in your email inbox.
     
  28. M3NTA7

    M3NTA7

    Joined:
    Apr 2, 2013
    Posts:
    4
    Thank you, I found it; for some reason it was hiding from me in my inbox o_O
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thank goodness it didn't escape! :)
     
  30. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
  31. Spagnutty

    Spagnutty

    Joined:
    Jun 1, 2012
    Posts:
    3
    I am so excited for the in line sprite feature!...!!!
     
    Stephan-B likes this.
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Me too :)

    I should be able to make good progress on this feature this week as the holidays are now over.
     
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    First look at the TextMeshPro SpriteAsset Editor Panel which will be used in conjunction with the new <sprite=xx> tag. Once the SpriteAsset is created, you will be able to adjust the offset values (OX and OY) to position the Sprite relative to the baseline of the text. It will also be possible to adjust scale by changing the SF value.

     
    Last edited: Jan 10, 2015
  34. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    So many great features in this tool.
     
  35. BonyYousuf

    BonyYousuf

    Joined:
    Aug 22, 2013
    Posts:
    110
    Hi,
    I bought your plugin so I can use bangla text in my game. But still haven't figured things out. I want to have this text

    রক্ষা করার দায়িত্ব কার?

    How can I do that? When I tried to do it in unity's own Text element, it gets broken and shows up like the image shown here

    Please help
     

    Attached Files:

  36. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Can you link the font you are trying to use?

    EDIT - I did find a font Bangla which I used to create the following. I simply copy / pasted the text.



    Here are the settings I used to create the font asset. The character range for Bengali is 0980-09FF (2432-2559). I also added the normal ASCII 32-126 in case but this font doesn't seem to include them. This font ttf (design) doesn't seem that great so hopefully there a better Bengali fonts to pick from.


    EDIT 2 - Same text using the Microsoft Vrinda Bold font.

     
    Last edited: Jan 23, 2015
  37. BonyYousuf

    BonyYousuf

    Joined:
    Aug 22, 2013
    Posts:
    110
    Hi,
    Thanks for trying it out. But this is the same problem that I have. In bangla there are compound word which is not showing up as you would expect. For example see the first word in your example. It should say "রক্ষা" but it is saying "রক্ ষা". And that is the problem

    This is what it should look like in case your font is not showing up correctly on the browser.

    As for font, you can try any as long as you can make it look like the attached image
     

    Attached Files:

  38. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It is wrong in the unity editor text field which means it is not interpreting the characters / using the correct compound word. Please file a bug report with Unity.
     
  39. BonyYousuf

    BonyYousuf

    Joined:
    Aug 22, 2013
    Posts:
    110
    Well, it is not just about unity editor. You can type it properly in c-sharp file in MonoDevelop. But when you retrieve that text dynamically, it gets broken like your own example.
     
  40. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    I don't have any experience with Bangla text nor font stuffs but seems like you are looking to have Ligature in TextMeshPro, maybe Stephan B can help you to have a list of ligatures thing and show 2 or more characters as just one glyph
     
  41. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    WISH LIST:
    1) Do you know when you will have a TextMeshPro Input Field ready? Unity's Input Field cannot be alligned in the middle, only upper. I hope this is fixed in yours.
    2) Is there (Or will it be ever) a way to count the culculated TextMeshPro (UGUI or not) text height (In a text with multiple lines) so that I can use this value on its RectTransform Height which is used as a Scroll Rect. I need this because when the TextMeshPro text changes to another language the Scroll Rect Image Height should change too with the correct new Height so that It will scroll correctly till the end.
    2) About TextMeshPro - Font Asset Creator. Will it be an option to get all multilanguage characters from the font at once? For us that we make game in multiple langages and we need it to have everything inside.

    Thanks,
     
  42. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Revised Sprite Asset Editor Panel
    Had to make changes to the editor as trying to display and scroll through a larger list of Sprites was insanely slow due to how the Unity editor handles the layout of items even if they are outside the scroll area. Now instead of scrolling through the items, they are displayed as pages.

     
  43. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    I recently bought and started using this awesome plugin in my project. First I wanted to say that it's such a good plugin and a must have. Thank you for making it :D

    While using it, I encountered some issues:
    - When creating font asset, if the text file for character set has new-line character the font generator goes crazy and the resulting asset won't work! This way I can't use a localization file as input. It also writes to log everytime encounters a duplicate letter in the file. It would be awesome if there was an option to import all of the glyphs that the font supports (unity already does this).
    - TMPro_AdvancedLayout creates a lot of error messages when first attached. It has something to do with the ScaleCurve being null. Also the default scale of the curve is so small that at first I thought it doesn't work at all!
    - I couldn't make a new SDF font material for the asset I created (to set different parameters like bevel etc). I've seen you do it in the examples. I just can't figure it out ;)
     
  44. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    Also, the first time font loads it writes a lot of debug info to the console... it's so much that the impact was visible on the profiler. Good thing that I have the source code and could just turn it off myself :D
     
  45. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You are welcome and it is my pleasure :)

    Which version of TextMesh Pro are you using? I fixed several issues with the Font Asset Creator and I believe this one has already been fixed.

    In terms of adding all the glyphs contained in a font, most fonts contain too many to do that. Unity's dynamic font system add them as you use them dynamically. There are benefits to the system and downsides. However, adding dynamic SDF Font support which will offer the best of both worlds is on my list of things. I have made several posts in this thread and the Asset Store thread about this so you can look them up for more details.

    That was (is) an experimental component which has been replaced by simple scripts in the latest beta releases as the underlying data structure has changed. These new demo scripts on how to add jitter to text or warp are part of the Demo & Extra Content package on the TextMesh Pro User Forum.
     
  46. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    That might be warnings related to some missing glyph. If it is something else and are using the latest beta release from the TextMesh Pro User Forum, please post in the support section so I can take a look at it.
     
  47. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    I bought the plugin a few days ago... so I think it's the latest version 0.1.44.
    Hmmm... I checked it again, the font asset creation bug happened once and then I couldn't reproduce it again! But it add these 2 boxes to the font. I assume they are '\n' and '\r'?

    2.png
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The latest beta release of TextMesh Pro with support for Unity 4.6 and the new UI is 0.1.46 B3.3 which is available to all registered users of the product on the TextMesh Pro User Forum. Once you have registered, you will find the latest beta releases in the "TMPro - Alpha & Beta Releases" section of the user forum.

    There were a few issues with the Font Asset Creator which have been address a few beta releases ago. The two square rectangles indicate missing glyphs from the font. With free fonts, I often run into missing glyphs where instead of leaving them empty, the designer used this empty square glyph in their place.

    The characters \n and \r are never rastered since they have no visual representation. I would cut and paste the content of your CharacterSet file into the Text Input to know which characters are actually missing.
     
  49. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I've noticed that you're using IDs for sprite tags. Did you consider adding names for sprites for convenience, so you could reference a sprite by name, not by an index?
    Also, any updates on the next beta release?
    Thanks!
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The ID's are nothing more than the index of the sprite in the Array. My only concerns with using names is that it will make the text input box even more crowded and hard to read with all these tags. Using ID keeps it cleaner / shorter and also avoids potential typos in the names. The same would go for <font=1> when that gets in there too.

    In general, I try to keep the tag short as the longer they are the more characters you have to iterate over to parsing the tags and text. Let's see how things go :)

    I am hoping to get this next release out in the next few days but stuff keeps creeping up. However, I feel pretty good right now. The sprite feature which paves the way for the <font=xx> feature as well as required changing a good chunk of internal data structures.
     
Thread Status:
Not open for further replies.