Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Text Mesh Pro - The Ultimate Text Solution for Unity - Powerful & Flexible - Advanced Text Rendering

Discussion in 'Assets and Asset Store' started by Stephan-B, May 29, 2014.

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

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Hey,

    I'm using TextMeshPro to create an e-reader type application. There are a few questions I have:

    1) Is there anyway to efficiently determine how many pages of text fit into a given text mesh? Meaning, I need to know the total amount of pages of text that would fit into the textfield, as well as be able to determine where the pages are broken up within the overall string so I can flip through them properly. Should I be testing bounds word by word (which I'm guessing isn't very efficient?), or is there a better way?

    2) Ideally I would allow for two columns of text. Is there anyway to achieve this using a single text mesh?

    3) Is there any way to determine when a specific word has been clicked? I need to have a few keywords that the user can tap on to launch other interactions.

    Anyway, thanks for such a great product. I'm coming from a flash background, which has traditionally been the top-of-the-line choice for simple, clean text ... Unity went from being sub-par for anything that needed clean text to being my first choice (even above flash) because of this product. If I can just figure this bit out, then all is great :).

    [EDIT -- Okay, I read through MOST of the 9 pages before me and then gave up. Of course, the post right before this is taking about pages ... go figure. Heh]
     
    Last edited: Dec 9, 2014
  2. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    563
    Hi,

    I love TextMeshPro but it sets the Scene Save flag as "Dirty" on every code change/compile. That's pretty annoying. Even if I don't change anything on the scene, Unity asks me to save the scene.

    Can you please fix this issue?
     
  3. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am currently working on the Text Overflow - Page Mode which should handle what you are looking for automatically. I should have a new beta release within a few days which will include this new feature.

    After showing page mode, I was wondering how long it would take before someone requested support for columns ;)

    I haven't started looking into implementing such feature. Layout out the text / mesh into columns is certainly possible. The challenge will be more on the UI side to allow users to define the columns. Thinking out loud, the RectTransform / Text Container will define the page and then using a similar widget like the current margins (yellow lines) could be used to define (visualize) the columns within the page.

    P.S. Assuming I add that feature, the next logical user request will be text flowing around object or images embedded in the pages. TextMesh Pro started as a simple replacement for Text Mesh. It is slowly evolving into a word processor :)

    Using the TextMeshPro.textInfo.wordInfo[] utility structure, you could implement your own method to track cursor overlapping those words.

    When I resume working on the run time Text Input Component, similar functionality will be in there. Until then, should you need any assistance with this, feel free to reach out to me or to post on the TextMesh Pro User Forum to request assistance.

    Thanks.
     
  4. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It should not be doing this but I'll look into it.

    What version of TextMesh Pro are you using?

    UPDATE - I loaded a bunch of scenes using the latest beta release and unless I change something creating a New Scene does not ask to save to previous scene. I also tested making code changes and was not asked to re-save the scene.

    Having said that, I did run into one type of scene that asks to re-save even though nothing was changed and those are scenes using a Content Size Fitter. Looks like this is a Unity issue with the Content Size Fitter as this occurs when using a button and putting a Content Size Fitter on a UI Text object.
     
    Last edited: Dec 9, 2014
  5. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    I don't have to officially start this project until the end of this week / beginning of next, so the timing of the pagification sounds like it will coincide perfectly.

    I don't need the columns at the moment (as this is just a first-gate prototype), but I do need to understand if this is something that can be done without a bunch of hackery on my part. You said that its possible, and that the bigger challenge is on the UI side. If I require this feature for this project, is it something that is already implemented but not yet accessible visually (nor requiring me to go swimming in code, since this project can't eat into the time we have delegated for other things), or will it be dependent on a future update that may-or-may-not occur? I need to be able to relate the pros/cons to the higher-ups. I don't need it to be done through a fancy-ui ... I just need to be able to create the columns and know that it works ;).

    I'll take a look at the word info for clicking on specific words. I was hoping that would be the case since I can visually tweak specific words (as per previous examples).

    Thanks again,
    Dale
     
  6. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Everyone will have to thank @Seith for requesting that page feature :)

    Since this is the first time support for columns is requested, I will have to reflect on this so no ETA yet. There might some short term ways to achieve using the TextMeshPro.textInfo and sub structures but again I'll have to think about it.

    I'll get the page mode done and then think about this. In essence this would be flowing the other pages (ie. the stuff that doesn't fit in the current Text Container / RectTransform into another. Once the page feature is released, a new textInfo.pageInfo[] as well as characterInfo[].pageNumber will be available. So you create a separate script similar to the ones I created to modify vertex colors or positions to iterate through the characters of each page and dump the character from subsequent pages into a new mesh.

    Since the page mode still lays out the entire block of text including word warping and all, the other would not have to worry about any of that. It would just need to drop those into a new mesh. Again, once this new feature is released, I'll give it further thoughts.

    I need to update the Demo & Extra Content package of TextMesh Pro which is available on the TextMesh Pro User forums in the 0.1.46 B2.4 thread. The examples should all still work and help you figure / learn more about this textInfo class. There are also videos on my YouTube channels going over some of this as well.
     
  7. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    563
    Steps to reproduce the dirty save flag bug:

    1) Create an empty unity project on Unity 4.6.1 (Old unity versions had the same problem)
    2) Download and import the TextMeshPro from asset store (0.1.44)
    3) Create a test script in unity project. You don't have to attach it to any scene object.
    4) Create a gameobject in the scene and add a textmesh pro component on it.
    5) Save the scene. And notice that dirty flag goes away from the Unity window title bar. This is in Windows.
    (For mac, see the icon in the window title bar becomes opaque from transparent)
    6) Open the test script file in a simple text editor.
    7) Just add a space character to the script and save it
    8) Come back to unity and wait for it to finish compiling.
    9) Check the window title bar and see the dirty flag comes back. The scene needs a save even if you didn't change anything in it. That really kills me every day at work.

    When I report a bug, it exists! It's very strange that you (as a extremely experienced Unity developer) didn't notice that problem while you were developing TextMeshPro or any other project for months.
     
  8. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you for reporting the issue and providing the steps to reproduce it. As per my previous reply, I didn't know what version of TextMesh Pro you were running so I tested with the latest beta release while awaiting your reply.

    I never doubted your report. My apologies if you got that impression. I simply stated that it should not be doing this but that I would look into it which I did.

    I haven't worked with version 0.1.44 for a while now other than for tracking down issues reported by users and this is the first time this issue has been reported. I have been working on the newer releases to add new features and support for Unity 4.6.

    I do my best to find and quash all bugs but like Pokemons I can't catch them all ;) I am grateful when users report issues and help with testing the beta releases.

    In terms of this particular issue, it is a validation issue. To resolve it, you can make the following changes in the TextMeshPro.cs file line 49 where the check needs to be added. Line 8 in the code below is the changed one.

    Code (csharp):
    1.  
    2. /// <summary>
    3. /// The TextMeshPro font asset to be assigned to this text object.
    4. /// </summary>
    5. public TextMeshProFont font
    6. {
    7.      get { return m_fontAsset; }
    8.      set { if (m_fontAsset != value) { m_fontAsset = value; LoadFontAsset(); havePropertiesChanged = true; /* hasFontAssetChanged = true;*/ isAffectingWordWrapping = true; /* ScheduleUpdate(); */} } // Change this line
    9. }
    10.  
    P.S. Thank you for reporting this issue. If you are interested in helping out test the latest beta releases of TextMesh Pro to help make sure they are ready for general release, please head over to the TextMesh Pro User Forum to register if you haven't done so already. Once registered, you will have access to the latest betas.
     
    Last edited: Dec 10, 2014
  9. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    563
    Thank you for your detailed answer. I'm sorry if I made you feel offended. It wasn't intentional.

    I'll check the textmesh pro forum. Thank you.
     
  10. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You didn't and I truly appreciate that you took the time to report the issue.

    Cool.
     
  11. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Thanks, that sounds more than reasonable. In the mean time, since this is a gated iterative approach, I can still work on things without requiring columns. It just means that sometime in the future I may have to switch to a completely different approach if they require columns and it cannot be done. I'll burn that bridge when the time comes ;).

    Are you building in the ability to track the maximum amount of pages? For example, if I need to display that the user is on page 20 of 250 ... will the new update support grabbing the number 250 out of the textfield through a maxPages property, or something of the like?

    Again, the user case is to build a simple e-reader (without pictures ;)). From what we've spoken about, it sounds like this should be able to support dynamic changing of font size, progressing backwards and forwards through the book based on pages, markup language for visuals, and clicking on specific words. However, do you see any issues with assigning a *massive* string into the textfield (ie: a book)? Is the page feature meant for smaller-scale strings, or will it work on a larger scale? I don't mind if it requires a bit of time to re-configure itself ... has it been tested against something that large though? It sounds like the columns (which I'm going to ignore until a later date) and the size of the string are the only two real unknowns left ... so rest assured, I'll stop bugging you shortly :).

    Sorry for all of the questions. I very much appreciate the amount of time you put into both your product and your support. I would wait until the next update before asking these questions, but I'm actively holding off on the project until then, so I need to inquire into if the update will actually be appropriate for what we're doing.

    Thanks again!

    [Edit]

    Hey, it also occurs to me: are you able to store the indices of each page in terms of the overall word array? It would be really useful if I could compare a words position in the overall array to the indices of the pages. That way, if I needed to do a search feature, I could simply find all the words that match, and easily grab (a) the surrounding text and (b) the pages they are found on. Just figured I'd throw that out there since your in the middle of working on that right now ... no idea if its possible based on how your programming this, but I'd hate to let that slip by just because I didn't ask!
     
    Last edited: Dec 10, 2014
  12. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Hey,

    Is it possible to add a new rich text tag on my end, or is that in your .dll? I want to create a <id=name>text</id> tag, where the tag would store the index and number of words in the tag in a dictionary. That way I could find specific chunks of text at run time by querying ids.
     
  13. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This type of feature potentially goes beyond columns of text as it leads into having text flow from one container to another which can be implemented in various ways. The trick is to find an efficient and elegant method to implement the column type feature sort of paving the way to enable even more functionality down the road.

    Tracking and control over displaying pages is a property. TextMeshPro.pageToDisplay(int page); Tracking how many pages we have is already there in the form of TextMeshPro.textInfo.pageCount;

    The biggest challenge here is the limit on the number of vertices that an mesh can have which is 65535 which is a Unity limitation which means we can only have about 16000 characters per object. So the column thing and having text flow from one container to the other comes back in focus. The current page feature for dialogue or a few pages should work fine for more complex needs, maybe each page should be in an array of string for each page. Then to display the new page, we simply change the TextMeshPro.text = book[page54];

    As per my comments above, we have a definite limitation on the number of vertices / characters per mesh.

    Dealing with a massive string would also not be practical. Maybe the content is stored in a file and instead of submitting the text one page at a time, you supply more to provide padding before and after the current page. In the event the font size is reduced, since the current sub string already includes this extra content, using the current page feature to display it should not be an issue. The challenge is find a nice transition point to update this sub string. Basically, I am think that the text object is always showing the middle of the sub string. Assuming the user is looking at page 10. The sub string would actually include page 9, 10 and 11. If the point size is reduced, the user would see a bit of page 9 and page 10. This is handled by the current page feature. If the user turns to page 11 then we need to update the sub string to include page 10, 11 and 12. The text will need to be synced between those page transitions but I am not sure yet how that is going to play out. We will just need to figure what additional information might be required in the textInfo class to manage this.

    Questions are good :)

    I think the content should be stored in a text file and searching through the content should be done via whatever method is most efficient for that. The results which contains the matching query would then be supplied to TextMes
     
  14. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    This almost sounds like InDesign/PageMaker/FrameMaker for Unity the way features in TextMesh Pro keep coming in. :)

    Do you have an estimate ( best guess) on when you will be doing an official release? Also do you plan on updating the asset store with your current beta versions?
     
  15. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Storing the text in a file is fine, but how does the user know where the page indices are before he's actually supplied the text to the TextMeshPro? How would he know what chunk of text to supply for pages 9-11, when the page breaks need to be determined by the TextMeshPro to take the dynamic text sizes into account? If there are 300 pages of text total, the user needs to know where all of the split indices are ahead of time in order to determine which part of the text to supply ... not to mention how many pages total there are. Until that information is accessible, there's no way for the user to supply the text in chunks ... so an upfront parsing of the entire string is still needed (unless theres a better way thats escaping me). Furthermore, for the search feature: I agree, searching the text would be done outside of the TeshMeshPro. But I would still need to know where the indices of the pages are in order to allow the user to flip to the correct page.

    It sounds like the user would need to supply the entire string, and have an array of page indices returned (or the equivalent of). That way he would know up front (a) how many total pages there are, and (b) he could supply only a few pages of text at a time for performance reasons, and (c) whatever other functionality he comes up with. Once the user has the indices of the pages within the entire string, it becomes very easy to implement all sorts of custom functionality on the user's end without requiring anything further from the TextMeshPro. If its not practical to parse such a huge string for performance reasons, the string could be parsed ahead of time and the indices per font size stored in a lookup table. Additionally, if the user has the page indices, he can simply pass in the amount of text needed for the visible pages (as you mentioned), which could actually allow me to hack around the whole column thing by having two TextMeshPro objects on the screen, and simply supplying the second one with the next page's text ... that way there's no reliance upon you implementing a column system to go through with this project.

    Anyway, thanks for discussing all of this.

    [Edit -- for the record, I'm just trying to get across my use case properly. I don't understand your code base properly, so I don't expect to have an actual back and forth convo about this ... just enough to feel confident that if there's a problem with what I'm assuming is coming down the pike, you'll let me know.]
     
    Last edited: Dec 11, 2014
  16. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I never thought I would be making a word processor / tool like In Design but it is sure kind of heading in the general direction.

    The latest beta release is feeling much better with support for all the new UI / Unity 4.6 stuff. These beta releases are available to all registered users of TextMesh Pro via the TextMesh Pro User Forum.

    In terms of the AssetStore Package, there are still a few features that I want to add plus I need to wait for Unity to address some of the outstanding issues in Unity 4.6. For instance UI Mask only supports 3 layers right now where it should support 8. So until Unity 4.6 is looking pretty solid with all the features I rely on working, I would rather wait until then before updating the AssetStore Package. I expect that I'll be releasing a few more Beta Releases on the TextMesh Pro User Forum and during that time, I am adding new features :)
     
  17. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This is a good discussion as it helps me get a better understanding of the type of functionality that would be required.

    Lets take the conversation to PM or email as I need to get a better understanding of your application and how you envision your end users using your application. With that better understanding, I can then figure out the best way to handle this.

    Just a few quick note: We don't really have a choice on storing the text in some file due to its potential size. We also can't feed the entire text to TextMesh Pro due to the vertices limitation on the Unity side plus if we are only displaying one page of 100, processing the whole text for just one page will be very inefficient.

    We need to break up / manage the text file into manageable bit size. If tags like <page=10> </page> can be added to the large text file then you could create a script that would return that page of text from the larger file. Then it could be provided to TextMesh Pro. If that page of text turns out to be larger than the reading area then the current page mode would handle that automatically. In this implementation changing the point size would be fine as TextMesh Pro would redo the page mode for the current supplied page from the text file manager. When the user ends up at the end of that page, then you would fetch a new page from the text file manager.

    Since I don't have a full understanding of your needs yet, a potential issue with this technique is that it would behave like a book. Pages would always started at the top and the sub page could end up with just one line of text on it before a new page is loaded. Meaning the content of Page 1 would never blend into Page 2.
     
  18. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New Rich Text Tag - Monospaced
    This new rich text tag will forcing character spacing to be monospaced. The new tag format is <mspace=xx.x> </mspace>.

    Here is an example showing this new tag along with a few newly added ones.
     
  19. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New! Text Indentation Tag
    I just added a new rich text tag which provides control over character indentation within the same block of text.

     
    Last edited: Dec 14, 2014
  20. imaleper

    imaleper

    Joined:
    Nov 14, 2012
    Posts:
    30
    It seems like the auto-sizing feature only works with the TextMeshProUGUI component, is there any way for me to transfer that functionality to the non UGUI component script?

    Thanks
     
  21. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The functionality is the same across both Components with the exception of the support for UI Mask which is specific to the new UI.

    The text auto sizing functionality was added back in beta release 0.1.45. The latest beta releases which include many new features are available to all registered user of the product on the TextMesh Pro User Forum.
     
  22. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    I have a game title/logo, and the text has been tweaked a lot in Illustrator, then exported as a tga for Unity. Is there any way to use that in TextMesh Pro? I'd love to get some of these effects on it, but it would be hard to recreate all those tweaks in TMP. I am assuming it's not possible, but figured I might as well ask.
     
  23. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Has the text been imported as a font or as a Graphic?
     
  24. Stephan-B

    Stephan-B

    Unity Technologies

    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 :)
     
    Peter77 likes this.
  25. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    It has to be a graphic, since there's too much don't work to reconstruct it with a font in TMP.
     
  26. Stephan-B

    Stephan-B

    Unity Technologies

    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.

     
    Peter77 likes this.
  27. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    That looks fantastic! When do you expect it to be available?
     
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hey, great job - TextMesh Pro looks fantastic!

    I was wondering if you'd had a chance to investigate Arabic text support?

    I'm curious whether the text effects will still work as Arabic text has all the characters joined together (like cursive script)..

    A example piece of Arabic that I'd be interested to see in TextMeshPro is: يُبيّن

    I also understand that listing the characters is required. It would be nice if you could instead add multiple ranges of unicode values..

    Thanks!
     
  29. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are a few post in either this thread or the WIP about support for Arabic.

    I guess there are two issues. The first is I am not certain the Unity Editor (text field) understands Arabic as pasting those characters in the editor yields different characters. In order to draw the correct results, I need to get from the Unity Editor Text Field the correct unicode.

    Second, just like cursive, the outline becomes an issue but you can cheat to get around it by using a duplicate object to produce the outline or effect you are seeking.





    The Font Asset Creator offers different modes to define which characters to include. One of those modes is Custom Range(s). So you could for instance request characters from "32-126, 1536-1901" which would include Arabic + supplemental characters.
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Amazing!
    Yes, we've been doing some Arabic work recently. We had to use this plugin to get the Arabic text converted to that Unity could render it correctly:
    https://www.assetstore.unity3d.com/en/#!/content/2674

    It wasn't perfect though. There are some 'diacritic' characters that appear above and below some characters and Unity renders slightly offset in the wrong place. I think this may be a fundamental problem with the text rendering library they're using as I read about quite a few other projects online that had similar issues until they updated their libraries..

    The idea of using 2 texts to get the outline working is great.

    Excellent work,
     
  31. Stephan-B

    Stephan-B

    Unity Technologies

    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.
     
  32. DodgeRollBrent

    DodgeRollBrent

    Joined:
    Dec 15, 2012
    Posts:
    7
    Hi!

    I am working on a game that uses low-resolution pixel art, and I would like my text to match up visually. I am trying to get my pixel font to have a hard, single-"pixel" outline, but when I use the underlay (or any other dilating effect) I get rounded corners where I would prefer to have nothing.

    I'm guessing this is because of the way the signed distance field is calculated (if diagonals were somehow completely ignored in the calculation, i think my problem would go away), but I can't get to it because it is precompiled into a DLL. Any thoughts?

    Thanks!
     
  33. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The issue with sharp transitions is due to where the sampling of the distances is taken. Imagine that each letter is contained in a grid of 32 X 32 pixels. As the distance is computed for each of those pixels, some of them will end up exactly on a corner at which point the sharp corner will be preserved but in some other cases, the sampling may end up on either side of those corner at which point that corner will end up rounded.

    Here is an example of increasing the Atlas size which increases the sampling which enables us to preserve the shape better (especially where sharp transitions occur).



    On a 512 X 512, sharp corners appear rounded. At 1024 X 1024, it is not as apparent and a happy medium between Font Asset size and visual fidelity.

    Here is a close up on one of the corners with 4 letters overlapping. White is 512 X 512, Green is 1024 X 1024, Red is 1024 X 1024 (Distance Field 32), and Blue is 2048 X 2048.

     
    Last edited: Jan 2, 2015
  34. DodgeRollBrent

    DodgeRollBrent

    Joined:
    Dec 15, 2012
    Posts:
    7
    Sorry, I don't think I was clear enough:

    My problem isn't in getting the text itself to render sharply, it is in getting an outline or an underlay to ignore "diagonal pixels." As an example:

    Capture.PNG

    The text I could get sharper fairly easily, but the underlay will have rounded "corner" areas. What I really need, I think, is the distance field to only measure distance along horizontal and vertical axes, unless I am mistaken.
     
  35. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Ok. I understand what you are looking for now.

    The problem is that Dilation, Outline, Underlay Dilation, Glow Offset, etc are all based on the same distance data in the Font Asset. As the effect moves away from the edge, the distances are scaled and thus the corners will get rounder and rounder.

    Here is an example of adding a Stroke to a letter in Photoshop. As the stroke moves away from the original shape (sampling point) you get those rounder corners.



    I am not too sure how we could dilate the shapes while trying to preserve the sharp corners.

    The only thing I can think of is to do what Unity's Outline Component does which is to stamp the Mesh 4 times with an offset as per the image below.



    So 5 mesh are used here. The Original White text + 4 offset stamp (-0.1, 0.1), (0.1, 0.1), (0.1, -0.1), (-0.1, -0.1). A script could be created to grab the mesh created by TextMesh Pro and then create a modified mesh which would add the 4 offset stamps and then the original data last to make sure it is drawn on top.

    For Square Block letters, this would work but for letters with angles corners or curves, not so good.

     
    Last edited: Jan 3, 2015
  36. jasonMcintosh

    jasonMcintosh

    Joined:
    Jul 4, 2012
    Posts:
    74
    Will there be another beta on the asset store soon, or should we plan to get it from your forum for the foreseeable future?
     
  37. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I would get the latest beta release from the TextMesh Pro User Forum. I am still waiting on a few fixes in Unity 4.6 plus I am pretty far into the sprite tag feature implementation so I may as well hold off on revising the Asset Store package until then unless those Unity fixes show up in the next patch or something.
     
  38. Stephan-B

    Stephan-B

    Unity Technologies

    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
  39. Kea

    Kea

    Joined:
    Nov 12, 2012
    Posts:
    23
    I use version 0.1.44 and can't find Autosize option, like in this video:


    How i can made autosize text?
     
  40. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Text Auto-Sizing feature was first introduced in Beta Release 0.1.45. The latest beta release is 0.1.46 B3.3 which adds several new features and is available to all registered users on the TextMesh Pro User Forum.
     
  41. tealm

    tealm

    Joined:
    Feb 4, 2014
    Posts:
    108
    I also need the auto-sizing feature shown in the video.
    Is it possible to use the beta release on Unity 4.5.5f1?. I only want to add the auto-sizing feature to my app without upgrading to Unity 4.6 and the new uGUI.
     
  42. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The latest beta release (0.1.46 B3.3) will work with Unity 4.3 / 4.5. As per my previous post, these releases are available to all registered users of the product. If you haven't done so already, go registered to the TextMesh Pro User Forum to get access to those beta releases.

    P.S. There is are 2 prefabs which are referencing one of the Unity 4.6 class in this beta release, so you will need to either delete them or un-select them during the import process.
     
  43. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,418
    The sprite-tag-feature does still work within Unity 4.3.X, right?

    And do I need to create a certain sprite-atlas within TMP or can I use 2DToolkit-Sprites or Unity-Sprites, too?
     
  44. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am still working on it but I do plan to have this work in Unity 4.3 as well.

    I added a new item to the Create Context Menu to allow you to create those TextMeshPro Sprite Asset from Unity Textures marked as Sprite (2D and UI) in the importer.
     
  45. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,418
    Uh, gonna love that.
     
  46. LampRabbit

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    29
    Would there be a way so users could set the default settings of a text mesh pro component, I find myself setting the text alignment to center all the time.
     
  47. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Is there any option to have an Input Filed that supports Text Mesh Pro?
     
  48. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    When I have a chance, I could look at giving users a way to define default settings.

    Until then, in the TMPro_Private.cs file for TextMeshPro Component and TMPro_UGUI_Private.cs file for the new UI TextMeshPro Component around line 100, you could change the default using Center as per the code below.

    Code (csharp):
    1. private TextAlignmentOptions m_textAlignment = TextAlignmentOptions.Center;
     
    LampRabbit likes this.
  49. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Not at this time but I have begun work on the TextMesh Pro Run Time Text Input Component. Release of it is way overdue but the Unity 4.6 stuff has kep me busy but it will be coming.
     
    TechnicalArtist likes this.
  50. mlamplmair

    mlamplmair

    Joined:
    Dec 15, 2014
    Posts:
    14
    I will use TMPro for a 2D UI System in Unity 4.6.1p4. In the Editor I can see the Text but in the Game Window i can't see the text (which is orthographic). What do I wrong?
     
Thread Status:
Not open for further replies.