Search Unity

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

    sschaem

    Joined:
    Feb 14, 2014
    Posts:
    148
    The snapping can be done I believe from changing this

    float4 vPosition = mul(UNITY_MATRIX_MVP, vert);
    to
    float4 vPosition = UnityPixelSnap(mul(UNITY_MATRIX_MVP, vert));

    But thinking about it, this wont work because you only want to correct the baseline position, but this will affect glyph position AND size.

    So your best looking option would use the SDF font for 10pt and above, and below 10pt switch to a hinted bitmap font.

    If this is not an option, the code that create the geometry would need to do the coordinate adjustment.
    The baseline would be pixel snapped when the geometry is created... (and optionally the xstart of the glyph)
    This wont look at sharp as the hinted bitmap version, but you can still use auto sizing features.
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Hi,

    Using Unity 5.3.beta5

    I get this message: Assets/TextMesh Pro/Editor/TMPro_CreateObjectMenu.cs(109,42): error CS0619: `UnityEngine.EventSystems.TouchInputModule' is obsolete: `TouchInputModule is no longer required as Touch input is now handled in StandaloneInputModule

    How do I fix this? - Using latest TextMesh from the store.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Get the version from his website.
     
    MrEsquire likes this.
  4. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    Hi to all people!!! I have a problem using unity 5.2.2 and text mesh Pro, When the scene load I got 99.9% memory use from TextMeshProFont.OnValidate()/Loading.ReadObject/Loading.AwakeFromLoad this cause crash on iOS device, on Desktop cause a big lag. what could cause this? I did not have this problem on Unity 5.2.1... Help ... thank you!!!
     
  5. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Hi stephan,

    I've got a weird bug that all TMP texts disappeared quite regularly in two of my android devices. But if I change the orientation in game then the texts reappear. First I thought because my scene was laggy, since the first device only dips around 20-50 fps, but my other device stay smooth at 60 fps, and it still happens.

    Happens only on UGUI, 3D text works fine. I do a lot of de/activation of said gameobjects.
     
  6. TopThreat

    TopThreat

    Joined:
    Aug 7, 2012
    Posts:
    136
    Hi, How hard is it to get something like this: Using a text input field and then based on what is typed in, text is displayed in a textmeshpro field above it but with the effect you have here?
     
  7. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The example above uses one of the example scripts included with TextMesh Pro to reveal the text. So in theory, you should be able to grab the text from the Text Input Field and simply assigned it the TMP text object which is using this script or a revised version to suit your needs to display the text.
     
  8. lcresswell

    lcresswell

    Joined:
    Jun 26, 2015
    Posts:
    1
    Hi there,

    Not sure if anyone is already aware of this but found a bug with the html tag hash system. If you enter a tag <ruft> it will calculate 1118 tag code which is the same as <font>. By looking at the calculations for the hash/tag code value there is a very good possibility that other examples of text could be calculated to the wrong tag code.

    Currently our fix is to check if the calculated m_fontIndex is not greater than the length of m_fontAssetArray length but that is just for scenario only.

    Cheers.
     
  9. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The hashcode function is getting an update in the next release where the likelihood of collisions will be further reduced and yet remain very efficient in terms of performance.
     
  10. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hia

    i just started using TMP for work and am completely overwhelmed by all of it and the wealth of info to take in... I hope this hasn't been asked before but for now I just need to know one thing and I am hoping someone can give me a quick and easy answer, please...

    I have to place text on a background that has a fixed width and the font must also have a fixed size BUT the background needs to adjust it's height to match the text at the fixed font size.

    So far I have seen the ability to adjust the font size to fit into a region but I have not seen anything about adjusting the region to enclose the text so I am wondering how I would go about doing that. Can anyone give me some advice, please? A means of determining how many lines of text I am showing and the total height for the specific piece of text

    I am prepared to have a non-visial off screen duplicate text object with the max height so I can just get the used height from there if need be but I will leave it up to you to tell me the best way to do this...

    Just to elaborate... Imagine I am making a comic book and I want the speech bubble to grow to fit the 12px font. I have decided to make the bubble 150px wide so now I need to determine how tall to make it to fit the text... What is the best approach? Thanks

    p.s. text may include scaled inline graphics...

    Thanks
     
    Last edited: Nov 15, 2015
  11. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I had a look at the forum on his website and found someone else asking the same question as me and also not getting a reply.

    Is that because the answer s so blaringly obvious that it doesn't warrant a reply or because there is no way to determine the total printed height of the text?
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I simply didn't reply because I was never notified by the Unity forum of your post. Ironically, I did get a notice about this second post of yours. Going forward, I would recommend you post on the TMP user forum when you need assistance as it makes it easier to keep topics / questions organized and is less likely that I will miss a post.

    Now to your question, I believe you should be able to set the text at 12 points with the text container (or recttransform) set to the width you wish to use. Then by using TextMeshPro.ForceMeshUpdate(); which will populate the textInfo class and preferred values, you will be able to know the bounds of the text (size), the number of lines as well as preferred height.

    I would suggest you post this question on the TMP user forum where I can provide this information as well as include an example script which will benefit other users who may have the same question in the future. This will also make it easier for us to communicate on this in the event you require further assistance.

    EDIT
    There might actually be an easier way (automatic) to do this using Unity's Layout components. I'll explore this while you post on the TMP user forum and provide the result there.

    EDIT 2
    Assuming your are using the Canvas system, this can easily be done as per my previous edit. Here is an example that should do what you expect.

    Here is the scene hierarchy
    upload_2015-11-15_15-19-40.png

    The button which I am using as the background has the following layout components.
    upload_2015-11-15_15-20-24.png

    Since the Content Size Fitter already tracks the size of the text and adjusts the button accordingly, we don't need any scripting. Since you want the width of the background to be fixed, we leave the Horizontal Fit to Unconstrained. The width is set by the RectTransform's width. The vertical is automatically adjusted by the content size fitter to fit the text.

    upload_2015-11-15_15-24-3.png

    With the vertical layout group, you can also adjust the padding around the text which is nice.
     
    Last edited: Nov 15, 2015
  13. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    OMG! I was hoping for some obscure value hidden in some wayward place in a class somewhere... I never used the Content Size Fitter before so I never realized it could be done automatically. This is the best possible answer! :D Many thanks!

    I'll be sure to go duplicate this question on your website also, as requested. Again, thanks a lot! :D
     
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You are most welcome and sorry I missed your initial post.
     
  15. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    @Stephan B
    Im currently in need of a dynamic text indent.
    i have a text like

    Code (CSharp):
    1. Title
    2. sometext
    3. - Long and tedious text that need to break around and keep the indent of the "- " in the beginning
    4. - Long and tedious text that need to break around and keep the indent of the "- " in the beginning
    that breaks like this:
    Code (CSharp):
    1. Title
    2. sometext
    3. - Long and tedious text that
    4.   need to break around and
    5.   keep the indent of the "- "
    6.   in the beginning
    7. - Long and tedious text that
    8.   need to break around and
    9.   keep the indent of the "- "
    10.   in the beginning
    Can your indent rich text tag work for that?
     
  16. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes. TextMesh Pro includes an <indent> tag which is designed for that purpose. Here is an example.



    The indent tag like most other tags can be defined in pixel units (px), font units (em) and as percentage of width (%).

    There are other tag like <align> which allows you to align individual lines of text like the text.


    There are over 30 rich text tags available in TextMesh Pro.

    EDIT - Here is an example using your text showing two levels of indent. Note this works with word wrapping and behaves as expected. The image below show the text object in the SceneView with a composite of the text input box (raw) text.

    upload_2015-11-19_1-59-9.png
     
    Last edited: Nov 19, 2015
  17. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Ah ok if i use a intend blick per indent line it should work...
     
  18. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Correct. If you look at the example above, you can see how I am using the indent tag. The first indent is never ended which means the effect is cumulative on the 2nd block.

    You would create bullets like this...
    (1)<indent=50px>This text is indented.</indent>
    (2)<indent=50px>This is also indented.
    a.<indent=100px>This is further indented</indent></indent>
    This is no longer indented.

    Again, you can use px, em or %.
     
    fffMalzbier likes this.
  19. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Looks like you need to update the documentation a little bit. The indent tag and the use px, em or % is not written at all or do you have another more up to date documentation somewhere else?
    em and % did not work at all for me.. it behaves always like 0px indent.
     
  20. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    A more updated list of tags and examples is available on the TextMesh Pro User Forum which I recommend you register for since that is where most of the information and latest releases are first available.

    With regards to the indent tag, I forgot the currently available release does not yet include a fix that I have made which is available here on the TMP User Forum.

    I am getting close to releasing a new version which will include this fix and other improvements.
     
    fffMalzbier likes this.
  21. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Is is possible to make the text width fit the content ? I know there is an auto-size font property but what I want is the opposite, the font size does not change but the text width changes in order to fit the content according to the current font size.

    Is that possible ?

    Thanks.
     
  22. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    That sound like a job for the content size fitter of unity's us system.
     
  23. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You want the width of the container of the text to change size? Like the background behind the text object?

    Are you using the Canvas system or just the normal TextMesh Pro component with the Mesh Renderer?
     
  24. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    From reading his question it sounds more like he wants the font height to remain the same but have the font width change. Definitely NOT a job for the content fitter, I'd say.

    I recently had a similar situation where I wanted the background size to adjust to the text at the current size. What I did was write the content to an offscreen component, ForceImmediate processing of the text and then fetch the hidden_object.bounds.size to determine the x and y size of my main game object. I learned afterwards of the preferredSize (or something) field but by that time my code was already done and working... so yeah, just fetch bounds.size to determine how much space the font will take up and then adjust your background accordingly...

    But what Klupe is asking sounds like something completely different... Like I have a background of 500px and I need to fit either "Cat" or "Supercalifragalisticexpialidotious" into that 500px area but I don't want to make my font height smaller... I guess this means the question is to open to interpretation to get a proper response :(

    How about I start off a new question and do it without ambiguity:
    When I change the value of the outline thickness, it does NOT go on the outside of the text like Photoshop's Stroke. The outline is always drawn on the INSIDE of the text, not the outside. How can I make the outline be on the outside of the text, resembling Unity's Outline component and Photoshop's Stroke?

    See? No ambiguity there :D First one with the correct answer wins a "Kudos" from me! :D
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Outline is always applied at the edge and spreads equally inwards and outwards. Now by using Dilation, you can basically control how the Outline is applied.

    For instance:
    - Outline 0.1 with Dilation at 0.0, means the Outline is applied at the edge.
    - Outline 0.1 with Dilation at 0.1 means the Outline is actually applied just on the outside since we made the text bigger.
    - Outline 0.1 with Dilation of -0.1 means the Outline is all applied inside.

    As these two controls are independent, you have better control over how these visual FX are applied.
     
  26. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I dont want the font to change at all - I just want the Text Container Width to fit the size of the text. So if I dynamically create an instance of TextMeshPro with the the text "Hello World" I want the width of the Text Container to be equal to the "Hello World" width according to its current font size.

    Is that possible ?

    Thanks
     
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes. If you are using the Canvas System, adding a ContentSizeFitter + VerticalLayoutGroup to the parent of the text object will do that automatically. This exact example / setup is shown in this post above.

    If you are not using the Canvas System then the same functionality can be implemented via scripting by using either the bounds of the text to size the object (container) behind the text or alternatively, you could also use the information contained in the TextInfo class to do that as well.

    Basically, this is pretty simple stuff.

    Note that TextMesh Pro replaces Ui.Text or the other Unity text components. However, it is not a UI system. TextMesh Pro won't re-size buttons or background images and stuff. Using the TextInfo class or bounds, you can easily implement those types of things.
     
  28. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    I'm not using Canvas system - so I'll look at TextInfo class - I didn't see understood that the bounds represent the actual text content size and not the container size.

    Thanks
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The bounds represents the size of the geometry used by the text object. So using TextMeshPro.bounds which is a shortcut for TextMeshPro.renderer.bounds will allow you to know exactly how big the text is.

    Please note that bounds along with other information contained in the TextInfo class is updated when the text object is rendered which happens just before the camera is rendered.

    So in cases like these, you may want to force the text object to be created sooner because you want to change the size of something based on the text, you can use the TextMeshPro.ForceMeshUpdate() function.

    See the following post http://digitalnativestudios.com/forum/index.php?topic=113.msg630#msg630
     
  30. alexandersb

    alexandersb

    Joined:
    Oct 7, 2015
    Posts:
    1
    Hi,

    I'm planning to acquire Text Mesh Pro for Unity later today and I just need to check some points about it. Can I just replace my text(Unity UI) components to Text Mesh Pro without any incompatibilities? Does the text component support autosize based on its text just like the Unity Text do (with ContentSizeFitter and Vertical/Horizontal LayoutGroup)? Currently I'm developing my game to Android, iOs, Windows Phone 8 and Windows Store, does it support all these platforms?

    I've sent you an email with these same questions, you don't need to reply one of them.

    Thank you very much.
     
  31. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I replied to your email a few minutes ago.

    The answer to your questions is all the same. Yes. TextMesh Pro does support all the functionality of the Ui.Text component and Unity Layout System. It does work with all the different platforms.
     
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    *** New Release is now available for download by all registered users in the private "TMPro - Alpha & Beta Releases" section of the user forum. ***


    TextMeshPro 0.1.52 Beta 3 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.52 Beta 2b and this new release. For quick reference here are the release notes for version 0.1.52 Beta 2.

    Upgrade Note - Since Unity's Asset Import doesn't remove older files or can get confused at times, it is best to remove the previous installation of TextMesh Pro by deleting the "TextMesh Pro" folder. This process works well as long as you didn't save any font assets, materials or any files inside the TextMesh Pro folder hierarchy. If that is the case, then be sure to backup those files first.

    Important Note I - This release includes significant changes to both TextMeshPro components. These changes were made in preparation for adding the Multi Font support as well as to make it easier to add new features and maintain these two components going forward. As part of these changes a few classes have been renamed which will affect user created scripts. For the most part, you will just need to change to the new types. Despite all the testing I have done with various scenes and projects, just make sure you backup your projects before upgrading to be on the safe side.

    Important Note II - Changes were made to how the pivot and offset position of the sprites is calculated. As a result you might need to adjust the offset position of your sprites in the Sprite Editor.


    Important API and Class changes
    • TMP_Text is a new class that contains the common functionality between the two TextMeshPro components.
    • The TextMeshPro and TextMeshProUGUI classes now inherit from TMP_Text.
    • The TextMeshProFont class has been renamed TMP_FontAsset.
    • The SpriteAsset class has been renamed TMP_SpriteAsset.
    • The TMP_FontAsset and TMP_SpriteAsset classes now inherit from TMP_Asset.
    • The TMP_Glyph and TMP_Sprite classes now inherit from TMP_TextElement.
    • The TMP_TextInfo.meshInfo is now an array. This change was done in preparation for the forthcoming Multi Font & Material support.

    New Features and Functionality
    • Added <lowercase> and <uppercase> rich text tags.
    • A new Scale property has been added to Font Assets to allow adjusting their scale. This was done in preparation for the Multi Font support to allow normalizing fonts with one another.
    • Added Spacing Offset property to the Font Asset Editor which provides the ability to adjust character spacing per font asset.
    • Added TextMeshPro.alpha property to make it easier to set the alpha value of the vertex color.
    • Vertex Color Gradients are now being multiplied by Vertex Color.
    • Vertex Color Alpha is now the lower value between the Vertex Color Alpha, Vertex Color Gradient and Face Color Alpha.
    • Re-worked the parsing of the XML tags to support multiple tag attributes in preperation for the Multi Font & Material feature. This will make it possible to use tags like <tag="string> param1=value param2="string" param3=value> making it possible to pass up to 8 parameters.
    • Add tint attribute to the <sprite> tag to control whether the sprite is affected by vertex colors. The new format is <sprite=0 tint=0> or <sprite="name" tint=1>.
    • Add color attribute to the <sprite> tag to control the color of the sprites. The new format is <sprite=0 color=#FF00FF80>. This can also be combined with tint.
    • Added EU currency symbol to Extended character set in Font Asset Creator.
    • Added Unicode Hex input format in Font Asset Creator.
    • Added Hex value to Font Asset Glyph Table.
    • Added support for UTF-32 in Font Asset Creator where glyphs in the UTF-32 range can be accessed.
    • Added support for UTF-32 input in the editor via "\U00FF00FF".
    • Added new options in the TMP Settings to control default text properties like Word Warpping, Kerning and Extra Padding as well as disable some of the warnings. More options can now easily be added.
    • Added support to get kerning data from ttf fonts on OSX.
    • Added GetLinkText() function to TMP_LinkInfo which returns a string of the link text.
    • Added GetLinkID() function to TMP_LinkInfo which returns a string of the link ID.
    • Add new functions to the TMP_FontAsset class to check for any missing glyphs.
      • bool HasCharacter(int character)
      • bool HasCharacter(char character)
      • bool HasCharacters(string text, out List<char> missingCharacters)
    • Added stack for indent tag.
    • Added stack for stlye tag.
    • Added stack to the <size> tag where using </size> reverts to the previously used size instead of the default point size.
    • Text Container now has basic support for RectTransform. * see note 1 below *
    • Optimized the update process of the normal TMP component which now uses an update manager instead of OnWillRenderObject callback which was constant per frame.
    • Optimized the TextMeshProUGUI component where it no longer uses WillRenderCanvases and now instead uses the CanvasUpdateRegistry. This will greatly improve performance when using lots of static text object.
    • Optimized how preferredWidth and preferredHeight values are computed when Layout components are used.
    • Added several new functions TextMeshPro.GetPreferredValues() to calculate the potential width and height of the text object given some arbitrary text input, width and height.
      • public Vector2 GetPreferredValues()
      • public Vector2 GetPreferredValues(float width, float height)
      • public Vector2 GetPreferredValues(string text)
      • public Vector2 GetPreferredValues(string text, float width, float height)
    • Added undo / redo support when new TMP Text objects are created.
    • The Mobile SDF Shaders now use a Keyword for the Outline to further improve their performance. Be sure to enable Outline in the material inspector on those Material Presets you have created which use an Outline.
    • Added a new example scene to serve as a basic scripting example of how to access and set properties on the text object.


    Improvements & Fixes
    • Improved support for WhiteSpaces and CTRL Characters
    • Improved support for line breaking for CJK.
    • Fixed an issue with the Midline vertical alignment.
    • Improved how line spacing is handled in preparation for the Multi Font & Material feature.
    • Improved the GetSimpleHashCode function to further minimize collisions between tags and custom attributes.
    • Fixed an issue with multi object selection with the TextMeshProUGUI component.
    • Add missing ON_TEXT_STYLE_CHANGED event to TextMeshPro component.
    • Fixed a minor issue with the Sprite Asset editor where small window size could cause an error.
    • Improved how the Font Asset Creator handles character maps.
    • Fixed an issue related to accessing the TMP_Settings file when the file has been deleted or not loaded yet.
    • Add check for null material in SetShaderDepth()
    • Fixed an issue where links were double counted.
    • Fixed an issue where text objects would disappear when using Transform.SetAsLastSibling in conjunction with masking.
    • Fixed an issue where certain control characters being included in the text file used to generate font asset could cause an error.
    • Assigned ARIAL SDF, Default Sprite Atlas and Default StyleSheet to the "TMP Settings" file. This makes it possible for users to move those resources outside the Resources folder (if desired).
    • Kerning Pairs are now displayed using Page mode to improve editor performance.
    • Fixed an issue with the size tag where using invalid values like a string instead of a number would produce an error.
    • Fixed an issue where a maximum of 1000 kerning pairs were retrieved.
    • Fixed an issue with Hinted Smooth and Hinted Raster modes in the Font Asset Creator.
    • Fixed potential error when a Font Asset or Material preset is assigned when the material has lost the reference to its Font Atlas / _MainTex.
    • Fixed minor issue with <indent=value%>.
    • Fixed an issue with the <indent> tag.
    • Fixed an issue with line breaking and <noparse> tag.
    • Updated the Bitmap shaders to support UI.Mask.
    • Revised the getter implementation for faceColor and outlineColor properties.
    • Fixed an issue where using Overflow mode Ellipsis with no visible characters would produce an error.
    • Fixed a minor issue where new instance of material were created when using the font Material property and re-assigning the same material instance.


    Note (1) The Text Container now uses a RectTransform which is required by Unity when inhering from Graphic. This is actually handy as you can now use the RectTransform tool to size the Text Container. Having said that, a byproduct of the this is that you will get an error in scenes where a text object using a transform was saved when disabled. Since the object was serialized with a Transform which is automatically replaced by Unity's editor, we end up with an error which goes away as soon as the object is re-serialized and saved. I am not certain how to handle this since the error occurs in Unity's code.

    Note (2) This release includes a lot of the ground work required for the Multi Font & Material support. So unless any major issues are uncovered with this release or Unity 5.3, I expect to get the Multi Font & Material support along with Fallback done fairly quickly since most of it was working at Unite in Unity 5.1. Many users are anxiously waiting for the Multi Font Support and I really want to get this released ASAP.
     
    Last edited: Dec 9, 2015
    LHMatsuoka likes this.
  33. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Release 0.1.52 Beta 3 for Unity 5.2 & 5.3 is now available on the TextMesh Pro user forum.

    I'll give this release a few days and if all is well, I'll proceed to update the Asset Store release.
     
  34. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    Hey Stephan, I am trying to animate the alpha of each char in a text mesh pro component using a script. I been attempting to do this with textinfo.characterinfo but it seems to not work, how would I go about doing this?

    Also I am trying to log into your forums but I forgot my password, the password reset system is also not sending me the reset email :(
     
  35. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Send me an email directly and I'll get your password reset.

    There are examples scripts on the user forum but the 06c Link Example also includes an example of this. When you mouse over characters while holding down the shift key, you can chance the color per character. You can take a look at that piece of code as modifying alpha would be essentially the same process.
     
  36. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    I was able to finally get the password reset email, took a couple more tries.
    I just updated to the latest, I will look at the examples and check if I can figure it out, thanks :)
     
  37. uryokesh

    uryokesh

    Joined:
    Oct 6, 2014
    Posts:
    6
    Hey am trying to create a game which uses tamil language fonts. Using unity regular fonts am seeing issues when trying to display some tamil characters example: ரூ . Does using textmesh pro will help me solve this problem? if yes can you show me a screen shot of how this character is displayed in unity using textmeshpro? my usage is not limited to just this character but it will use all tamil language character part of the problem seems to be some unicode tamil characters are combined to form the resulting character, Kindly do let me know? if there is a trial version which i can try to make sure my characters are displayed properly it would be of great help if not do send me screenshots to uryokesh@gmail.com. Appreciate the help. Also my game is going to be deployed for IOS and Android i hope textmeshpro will work in both?
     
  38. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Tamil like several other languages use character substitution where two or more characters in the case of some languages are combined to form a single one. Unfortunately, I don't have support for character substitution yet in TextMesh Pro but it is something that I do plan on adding. I suggest you continue to pay attention to this thread or the TextMesh Pro user forum where I'll announce when such support is available.

    In terms of iOS or Android, TextMesh Pro works with all platforms supported by Unity.
     
  39. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Does this work in WebGL? Thanks!
     
  40. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Yes. TextMesh Pro works with all platforms that Unity supports.
     
    p87 likes this.
  41. noamgat

    noamgat

    Joined:
    Nov 22, 2009
    Posts:
    125
    Hi,

    We just purchased TMPro and have run into a problem - it seems like the Inline Graphic Manager only works with the UGUI variant of text mesh pro - what if we need to combine text and images on a TextMeshPro object on the world? What are our options?
     
  42. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am currently working on the Multi Font & Material support which will allow using different fonts and material per text object. This feature brings along the ability to use sprites inline with the text for both TextMesh Pro components. I am hoping to have the feature available within the next 14 days.
     
  43. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I noticed that preferredHeight property does not return the correct value right after setting the text - for exemple if I have a method name SetText(string text) which set a TextMeshProUGUI text and then Debug.Log the preferredHeight value - then the value will be wrong. If I kept Debug.Log the value in an Update method then the first time the value is still wrong and the second time the value is eventually right.

    Is that normal ?

    Thanks
     
    Last edited: Dec 16, 2015
  44. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    When any of the properties of the text object are changed, a flag is set to indicate the text needs to be regenerate that frame. Just before the camera is rendered and if the flag has been set, the text will be generated. This was done as a form of optimization as it doesn't make sense the regenerate the text several times per frame. So when setting the text, the textInfo, preferred values, bounds, etc. won't be updated until the text is generated.

    Having said that, there are time when you might need the text to be generated right away and for those times. You can use the TextMeshPro.ForceMeshUpdate() function which will force an immediate generation where the textInfo class will be populated, preferred values updated, etc...

    This has been the case for a while now. However, in the latest release of TextMesh Pro for Unity 5.2 & 5.3 which is available on the TextMesh Pro user forum (release 0.1.52 Beta 3), the preferred values are updated right away now.

    There are several posts on the TextMesh Pro user forum covering the ForceMeshUpdate() function as well as preferred values. A search should reveal a lot of additional information.

    Here is an example of using ForceMeshUpdate() http://digitalnativestudios.com/forum/index.php?topic=811.msg6198#msg6198

    In the latest release, I also added these new functions related to preferred values.
    • Added several new functions TextMeshPro.GetPreferredValues() to calculate the potential width and height of the text object given some arbitrary text input, width and height.
      • public Vector2 GetPreferredValues()
      • public Vector2 GetPreferredValues(float width, float height)
      • public Vector2 GetPreferredValues(string text)
      • public Vector2 GetPreferredValues(string text, float width, float height
    Here is a link to the latest release notes http://digitalnativestudios.com/forum/index.php?topic=800.msg6054#msg6054
     
  45. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Thanks for the explanations - Im' a pro user but I'm not sure how to access to the latest beta. I just tried to use the ForceMeshUpdate method and then Debug the preferredHeigth and the value is still wrong. So I'll wait for the new version, I really hope it will out very soon ;-)
     
  46. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    All you need to do to get early access to the latest releases is register to the TextMesh Pro user forum.

    Here is an example that will work with the current release. http://digitalnativestudios.com/forum/index.php?topic=677.msg5251#msg5251
     
  47. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Ok, I'll try to register. About the kink you shared I don't see anything different with my code - I modify the test, call ForceMeshUpdate and then try to display the preferredHeight value - and the value is still wrong. Surely I'm doing something wrong, in the meantime I wait one frame but it's not ideal.

    Thank you !
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Do you have a layout component attached to that object? Unity does take one frame to update the RectTransform values when a Layout Component is used on the parent.

    I did find a way around this in the latest release but having the RectTransform.sizeDelta or .rect width and height reporting as zero for that first frame kind of complicates things.
     
  49. rutz

    rutz

    Joined:
    Aug 21, 2013
    Posts:
    51
    I'm not sure where is the main thread for this asset. I just posted on http://forum.unity3d.com/threads/te...le-in-asset-store.227790/page-21#post-2428744. Let's me duplicate here.

    Your asset is pretty good. I can says it is the best text rendering asset in Unity3D.

    Now, I'm facing the problem of rendering Devaganari. It's completely fine for glyphs display but wrong order. You can see https://www.microsoft.com/typography/OpenTypeDev/devanagari/intro.htm how microsoft explains.

    If this is not currently in your road map, please consider this to be one of yours.
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Thank you.

    Adding support for diacritical marks, character substitution, ligatures and handling of languages which require shaping is on the road map. I don't have an eta yet but it is something that I definitely want to add to TextMesh Pro.
     
Thread Status:
Not open for further replies.