Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. Assets-Reporter

    Assets-Reporter

    Joined:
    Jul 4, 2015
    Posts:
    79
  2. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
  3. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I added a new TMP_Settings file where users will be able to define the Default Font Asset that should be used when a new text object is created. So instead of always using the ARIAL SDF font asset, you could use any font asset of your choosing.

    This settings file also allows specifying which Style Sheet should be used by the text objects.

    Additional settings could be added over time to this file.
     
  4. KOP3R

    KOP3R

    Joined:
    Feb 18, 2015
    Posts:
    13
    Hello,
    I just bought TMP and I wonder if it's possible to write multiple fonts in one Text Mesh Pro UGUI component?
    For example :
    "<font=someFont>TextText</font><font=otherFont>Text2Text2</font>"
     
  5. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    At the present time, only one font can be used per text object. However, the ability to mix different fonts and materials per text object is functionality that I am currently working on adding to the product.
     
    jay-jin and KOP3R like this.
  6. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I noticed with your plugin you have the ability to do an emission glow on the UI text. I was trying to do this same emission glow with Unity's uGUI buttons, panels, and sprites and was wondering if it's possible to apply the same effect to them? I ask this because I've been searching high and low to find a shader to produce an emission glow for Unity's UI components and nobody seems to know how to, or recommend how to produce the effect on UI.
     
  7. KOP3R

    KOP3R

    Joined:
    Feb 18, 2015
    Posts:
    13
    We are currently working on UTF-8 font characters and we have a problem with conversion to upper / lower case. I saw in your code that you simply increase char value.
    Example: When we have letter in Polish language "ł" -upper-> "Ł" we have big red 'X' instead of it.
    Do you have any solution for that issue?
     
  8. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I was reflecting on that a few days ago and actually revised the implementation to use the built-in char.ToUpper() and char.ToLower() methods which should handle this correctly.

    This change will be in the next release.
     
  9. KOP3R

    KOP3R

    Joined:
    Feb 18, 2015
    Posts:
    13
    Thanks for reply.

    We have tried it also but it doesn't work for us ;/ - it occurs by returning even more red 'X's (but we changed only 4 lines of code so it may be wrong solution).
    You could test your solution on some Unicode font. I attached the file with Polish letters in unicode. It would be great if you could check that character set.

    Font we're trying to use is: https://www.myfonts.com/fonts/fontfont/scala-sans-pro/
     

    Attached Files:

  10. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I just tested by creating another version of the ARIAL SDF font asset (as to not override the standard one) and using the characters in your text file and the ł and switching to uppercase, I got the Ł character. Create another font asset using the Arial font (give it another name) and see if you get the same results.

    The code needs to be modified in the following regions
    Code (csharp):
    1.  
    2. #region Handling of LowerCase, UpperCase and SmallCaps Font Styles
    3.  
    as well as
    Code (csharp):
    1.  
    2. #region Look up Character Data
    3.  
    It is also possible that the font you are using is missing those characters. I wasn't able to use your font since I don't have a license to it but when you generate the Font Asset with this font, you should be able to see those two characters in it.
     
  11. KOP3R

    KOP3R

    Joined:
    Feb 18, 2015
    Posts:
    13
    Thank you for reply.
    I will check this out asap.
     
  12. TogoMango

    TogoMango

    Joined:
    Oct 8, 2014
    Posts:
    5
    Hi. Stephan.B

    I'm using well your tool.
    I have some problem. When i control 'Face' n 'outline', i can see background color at type.



    Do you have some Thred of solved?
    thanks for great tool.
     
  13. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There are several posts related to this on the TextMesh Pro User Forum as well as here. Basically, the amount of padding used when the Font Asset was created is too small for the amount of Dilation, Outline, Shadow being used. Ie. The value of those properties is close to the maximum value and the shader is running into adjacent characters in the font asset.

    Many of the posts on the TMP user forum go in great details related to this but padding controls also the amount of range for those properties. Padding of 5 for a 512 X 512 is fine for most use. If the font atlas is 1024 X 1024 then padding should be increased proportionally. Now if you know that you won't be using Outline, Dilation much (value wise) you can lower padding to improve sampling of the font (ie. larger point size being able to fit) but if you know that you want a large range of shadow or glow, then you want to increase padding.
     
  14. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    355
    Hi,

    I'm really interested by your asset, but I have a question regarding a feature.

    Do you plan to do Text Wraping around object like in InDesign ?
    https://helpx.adobe.com/indesign/using/text-wrap.html

    And if yes, when ?

    I really need this feature to buy this asset :)

    Thanks
     
  15. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I do have plans to add similar functionality but no eta yet. This will come after the ability to mix different fonts and materials per object and the Text Input Field which are the main features I am working on right now.

    I also have the Dynamic SDF Font Atlas system that is a high priority on things to add.
     
  16. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    At the request of a few users, I added a new tag: <noparse> </noparse> in TextMesh Pro.

    This results in text enclosed within those tags not getting parsed. So for instance "This is an <noparse><u>example</u>.</noparse>" will show "This is an <u>example</u>."

    I also added support for typing Unicode characters in the Text Input Box using UTF-16 \u00EF format. This can be very useful when trying to access special characters / glyphs in a font asset like Font Awesome for instance.
     
  17. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,822
    I'm really interested in replacing ngui's UILabels with textmeshpro.

    I can't really find much information, especially with up to date version info.

    The two main concerns are: I need integrated clipping (textmeshpro to respect ngui clip regions), and I need textmeshpro to respect ngui alpha settings for parent widgets.

    I've looked through a few threads on the tmpro forum, but can't really find much solid information on this.

    Is there any solid, up to date information on how to do this?
     
  18. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I guess when I have time, I should consolidate the information related to using TextMesh Pro with NGUI.

    In terms of the clip regions, I wrote a script that sets the masking coordinates in TextMesh Pro to mirror the clips regions setup on the parents so that should work fine. There is a thread which contains a script for this on the TMP User Forum.

    In terms of the Alpha setting on the parent, I haven't checked that so I have no idea if that actually works. I presume that if it doesn't a similar script could be created to have the alpha of the parent affects the vertex alpha of the TMP object.

    If you end up purchasing, be sure to register on the TMP Forum to be able to download that masking script. In regards to masking or alpha, if it turns out that modifications or a new script is needed, be sure to post on the TMP forum to request assistance.
     
  19. RazaTech

    RazaTech

    Joined:
    Feb 27, 2015
    Posts:
    178
    hi!
    it would be great if you introduce an option , to replace automatically all previous unity text from scene or game , with text mesh pro...
     
  20. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    When I have some spare time (after getting the next major release out with support for multiple fonts and materials per text object) I can certainly take a look at creating a script to do that. I am pretty certain, creating such a script is within the scope / ability of many of my users (wink wink) :)
     
  21. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    460
    Hello, currently working on a mobile game here!

    While creating an UI, I noticed that the Unity UI text size is different in the editor than in the devices itself because of the screen resolution.

    This makes testing dialogues really tedious, especially with multiple devices.
    Auto sizing the text is visually terrible, because with scrolling text, the font size changes as the text scrolls.
    And without auto-sizing, the text becomes unreadable in certain devices.

    Does text mesh pro have a solution to this?

    I actually would prefer if the size I see in the editor is exactly the same as the size in any devices. This way, I have a more predictable outcome as to what it will look like in all devices.

    Stretching does not matter, that would actually be better if it does!
     
  22. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    How did you implement the text scrolling? Are you using a ScrollRect and a Mask? I am trying to figure out why the text would be changing size.

    I presume this is happening when the device has much higher resolution and the point size is small so it ends up being tinny?

    Once I have a better understanding of your needs, I'll be able to give you a better answer.

    I think the page feature in TextMesh Pro should be very useful for your dialogue needs. That feature is covered in towards the end of this video.
     
  23. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi,

    I'm sorry if this was asked earlier but I could not find any answer to this.
    Does Textmesh Pro support unicode? Specifically, I want to be able to show currency symbols. I am already doing this with a normal Textmesh but am interested in using TMP.

    Thanks!
     
  24. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro does support Unicode.

    When creating your Font Asset(s) be sure to include the specific characters you wish to use. There are different methods to pick from to selected the characters to include. Please see some of the following videos which covers Font Asset creation, shader assignment and material preset creation. http://digitalnativestudios.com/forum/index.php?topic=122.0

    To access these Unicode characters, you can copy / paste or type them in the Text Input Box. In the next release of TextMesh Pro, I have also added the ability to access Unicode characters by typing escape sequence like "\u00FE" for instance.
     
  25. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    As per the request of a few users, I modified the Font Asset Creator to include a report characters that could not be packed or missing from the font file.

     
  26. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi,
    Thanks for the reply. I will do this and let you know if I have any more questions.
     
  27. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi,

    I have run into several issues attempting to do what I want. First let me mention that .Net currently has 223 Culture names for retrieving a users locale information, this includes the currency symbol. This breaks down to approximately 50 or so unique currency symbols.

    I proceeded to create a font using the asset creator using the standard 94 characters plus the currency symbols as shown below using the Arial Unicode MS Font which all symbols displayed fine in the custom characters box.
    Now first if you take a look at the font atlas, you will see several square boxes which either represents a character or a part of a character. But when trying to use the generated font the image is all jumbled as shown in the second attachment.
    Now, look at the third attachment. I added this symbol ரூ to the end of "Hello World!ரூ". The space is now a red X, "HelloXWorld!ரூ" is now legible but the symbol itself does not look anything like the above and seems to be built out of two separate characters from the font atlas which I have highlighted in red. Actually several characters in the atlas do not look like the actual font character.

    I believe their could also be an issue with the fact that several characters are generally entered right to left.

    I do look forward to the update where I can enter the unicode escape sequence. It would be nice if I could enter a combination of ASCII as well as unicode. Another nice addition would be if I was able to open a font asset in the asset editor as well as save the atlas to an image.

    (I also included the characters below for your testing purposes please let me know if you would like the unicode sequences)

    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ر.س.‏د.إ.‏د.ب.‏د.ج.‏ج.م.‏د.ع.‏د.ا.‏د.ك.‏ل.ل.‏د.ل.‏د.م.‏ر.ع.‏ر.ق.‏ر.س.‏ل.س.‏د.ت.‏ر.ي.‏л€č£ރ₡ريالરૂ₪रुդր¥ರೂ₩д₮ਰੁłل.س.‏ரூరూ฿₴ў₫

    upload_2015-8-5_14-9-11.png

    upload_2015-8-5_14-11-37.png

    upload_2015-8-5_14-12-15.png
     
  28. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    @Mavina

    Can you please register on the TextMesh Pro User Forum and re-post this information / support request? This will make it easier to track and keep things organized while also making it easier for anyone else looking for similar information to find it. I'll copy / paste the relevant part of this reply in that new thread as well.

    I used the "Custom Characters" option in the Font Asset Creator using the characters list you posted above and got the following results.

    upload_2015-8-5_15-31-11.png

    You can see that the Arial.ttf font is missing 16 of those characters. I am using an updated version of the Font Asset Creator where it now displays what characters are missing or didn't fit in the font atlas.

    The Rectangles shapes is used (in some fonts) as a substitute for characters that are undefined (ie. missing). These are no longer displayed / taking space in the font atlas since the Missing Character report now provides that information.

    In terms of inserting ASCII and Unicode into the text input box, here is an example of how it works in the release I am working on.

    upload_2015-8-5_15-39-5.png

    In regards to ரூ when it is copy / pasted into the Unity text input box, it becomes two characters. As different consonants or syllables are used, they often combine and are represented by a third (unique) character. Unity's editor text input box doesn't handle any of that which is why we get two characters and render two characters. Basically, I would need to implement support for recognizing character sequences to then handle to substitution on my end.

    In terms of the garbled text, this might have occurred when saving the font asset over an previously created one or closing the font asset creator while it was still in the process of saving the font asset where the UV coordinates don't match the location of the characters in the atlas. I have run into that a few times but can never reproduce it to figure out exactly the cause.
     
  29. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi Stephen,

    Thanks for the reply. I will register on your forum and re-post. I have created 6 different font assets so far but have only been able to recreate the garbled text 3 times.

    Ok, so I checked out the ரூ character in a regular TextMesh and I see that it does not handle the character properly either. Do you think it will be possible for you to eventually handle this?

    With regards to the Unicode entry, how is entering many sequences at once done, separated by spaces?

    What is the ETA on update, I am using 0.01.44 with Unity 4.6.
     
    Last edited: Aug 6, 2015
  30. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I approved your registration to the TextMesh Pro User Forum. I strongly recommend you pick up the latest release of TextMesh Pro from the user forum which is release 0.1.46 Beta 5 which is located in the "TMPro - Alpha & Beta Releases" section of the forum. The Asset Store release (0.1.44) is actually pretty old and a lot has changed since then.

    No space is needed. You can chain them like \u00ef\u20fe

    Releases for Unity 4.6 have been available since the release of Unity 4.6. As mentioned above the Unity 4.6 releases are available on the TMP User Forum.

    P.S. Let me know if you still get the garbled text after updating to the latest release. Due to Asset Importer issues in Unity, I recommend you delete the previous TMP package before importing the new one. Typically deleting the previous install before updating is the preferred method as long as you make sure you don't save any resources (font assets, material presets, sprite assets) inside the TMP folder hierarchy.
     
  31. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Thanks for the info. I will get the update from the forum.

    What I meant regarding the Unicode entry was where I need to enter lets say 50 font character Unicode sequences. For each character, there are between 1-4 Unicode sequences.

    I have only been able to replicate the garbled text a few times but here is the error that I received when I did:

    IndexOutOfRangeException: Array index is out of range.
    TMPro.TextMeshPro.GenerateTextMesh () (at Assets/TextMesh Pro/Scripts/TMPro_Private.cs:1313)
    TMPro.TextMeshPro_OnWillRenderObject () (at Assets/TextMesh Pro/Scripts/TMPro_Private.cs:1048)
     
  32. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Do you have an example of those?

    Are you talking about typing those in the Text Input Box or when creating the Font Asset?

    Like I said before a lot has changed since release 0.1.44 so I would not worry about tracking down this issues in that version.
     
  33. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Did an initial pass at adding RTL language support in TextMesh Pro a few weeks ago. However, I am going to need some user feedback and help given I cannot read a single RTL language.



    Please see the following thread on the TMP user forum.
     
  34. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Here are a few:
    টা \u099F\u09BE Brunei Dollar
    ਰੁ \u0A30\u0A41 Panamanian Balboa
    ரூ \u0BB0\u0BC2 Tamil Rupee
    రూ \u0C30\u0C42 Telugu Rupee

    Mainly when creating the font asset.

    I downloaded the latest TMP (0.1.46 Beta 5 *** FOR UNITY 4.6 ***) and the Asset Creator does not have the "Missing Characters" feature.
     
  35. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You can use the "Characters from File" option to create your font asset where you would include all the characters you need. This would be much simpler than typing those unicode sequences.

    In terms of those characters, they are UTF32 which are defined with 2 surrogate pairs since chars / strings are only 16 bit. I need to do some checking to support adding those. Aren't any of those characters located within the UTF16 tables? According to Unicode, currency is typically located in 20A0 range.

    In terms of the Font Asset Creator, the "Missing Characters" feature is in the release I am currently working on. I am hoping to get that one out within the next few days although I am going to take a look at this first.

    EDIT: I just checked and the Tamil Rupee for instance is located at \u0BF9. I would assume most fonts have a UTF16 code for each of those currency symbols which wouldn't require using surrogates.


    I am also seeing two different glyph used for Tamil currency. Which is the correct one?
    ரூ௹
     
    Last edited: Aug 8, 2015
  36. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    That is what they are concerted to using the following function:
    public string GetUnicode(String s)
    {
    System.Text.UTF32Encoding encoding = new System.Text.UTF32Encoding();
    byte[] bytes = encoding.GetBytes(s);
    String unicode = "";

    for (int i = 0; i < bytes.Length; i += sizeof(int))
    {
    unicode = unicode + "\\u" + String.Format("{0:X4}", BitConverter.ToInt32(bytes, i));
    }
    return unicode;
    }
    I get the currency using CultureInfo.NumberFormat.CurrencySymbol

    BTW, when importing/using a Arial.ttf from the c:\windows\fonts folder, I copy over Arial.ttf I end up with 9 different fonts. I am wondering if there a way to keep the font in one complete file like it is before importing it.
     
  37. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I need to do more research on the encoding but like I said, I presume there is a UTF16 equivalent for those symbols.

    That is because you are importing the folder which contains all variants of Arial. Just import whichever Arial.ttf you wish to use like Arial Regular whose file name is Arial.ttf.[/QUOTE]
     
  38. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    New Release of TextMesh Pro for Unity 5
    Release 0.1.5 Beta 2.2 of TextMesh Pro for Unity 5 has been released! It is currently available on the TMP User Forum and should be available on the Unity Asset Store by the weekend (unless some major issue is reported).

    TextMeshPro 0.1.5 Beta 2.2 Release Notes
    Please carefully review the release notes before upgrading and always backup your project beforehand. These notes reflect the changes between release 0.1.5 Beta 2 and this new release 0.1.5 Beta 2.2.

    Important Upgrade Note about Rich Text Tag Changes This new release brings about significant changes to many rich text tags to increase their functionality by supporting tag values to be specified in Pixel Units (px), Font Unity (em) or as Percentage (%). As a result of this change you will most likely need to update your existing text objects and tags to use the updated format and values. For instance, the previous <size=%125> tag will need to be changed to <size=125%>. Tags that are not properly formatted will show up as text and won't be processed to make it easier to identify the tags that need to be corrected.

    Important Note for Windows Users related to the Font Asset Creator: If you are NOT using Visual Studio, you will need to install the Visual C++ Redistributable Packages for Visual Studio 2013. Please download and install "vcredist_x64.exe". These dll's are required by the Font Asset Creator and sadly no longer included in Unity 5.0.

    Important Note about Asset Importing Since Unity's Asset Importer does not have the ability to manage or remove files which are no longer needed, it is best to delete the previous "TextMesh Pro" folder / installation before importing the newer release. As long user created content such as Font Assets, Material Preset, Sprite Assets or any other user created files are not saved inside the TextMesh Pro folder hierarchy, this method of importing new packages will work best.

    Minor Note When importing this new package, you will get about 18 warnings (1 per material) related to the Material Editor. These are harmless and will only appear the first time the package is imported. This is a confirmed Unity bug which will be fixed in 5.2 or sooner according to Unity.


    New Features
    • Added new TMP_Settings file which allows users to define the Default Font Asset, Default Sprite Asset to be utilized as well as the Default Style Sheet.
    • Add support for non-breaking space (char 160)
    • Add new property to prevent characters like \n \t \r from being parsed.
    • Bold spacing can now be adjusted per font in the Font Asset editor.
    • Add the ability to reference Sprites by name as well as rename sprites in the Sprite Asset editor.
    • Added the ability to type UTF-16 Unicode characters in the Text Input Box. The format is "\u00FF"
    • Added <noparse> and </noparse> tag which prevents text parsing within the tags.
    • The Font Asset Creator will now report which characters were missing or unable to be packed in the Font Asset.

    Fixes & Improvements
    • Improved compatibility with Canvas Group Raycasting.
    • Revised the GetSimpleHashcode function to reduce the likelihood of collisions.
    • Fixed an issue related to selecting mutliple objects of different types.
    • Removed extra padding on sprite characters in the text object as it was unnecessary.
    • Revised how padding is used in conjunction with Dilation, Outline and other material properties which affect the bounds of each character.
    • Added 32 bit plugin and revised folder hierarchy to add 64 bit plugin into its own folder.
    • Revised how Event registration is handled which greatly lessens the allocations when lots of text objects are being used.
    • Fixed an error that would occur when saving a font asset just after it was already saved.
    • Fixed an issue where BaselineJustified wasn't being applied properly.
    • Fixed minor cosmetic issue with Auto sizing editor panel.
    • Improved how material inspector visibility is handled.
    • Add a warning in the material inspector when a new material is assigned where it doesn't match the font atlas of the Font Asset.
    • Revised how Strikethrough is handle when using Smallcaps.
    • Improved line spacing when using different point sizes.
    • Revised the FontStyle enum to accommodate more styles. New format is m_TextMeshPro.fontStyle = FontStyles.Bold | FontStyles.Italic to combine styles.
    • Improved handling of lowercase, uppercase and smallcaps in terms of character substitutions with international languages.
    • Improved handling of monospacing.

    Please be sure to report any issues related to this release in this thread which makes it much easier for me to track.

    NOTE I - Unless major issues are uncovered in this release, I'll be focusing (mostly) on getting support for mixing different font assets & materials per text object in the next release as well as support for Unity 5.2.
    NOTE II - Once it appears this release is stables, I'll be updating the Unity 5 release of TextMesh Pro available on the Unity Asset Store to this version.
    NOTE III - There is also an experimental / work in progress try at RTL support with the Normal TMP Component but I need user feedback on this since I can't read any RTL languages.
     
  39. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Work-In-Progress - Mixing different fonts and materials per text object in TextMesh Pro with the <font="font asset" material="material name"> tag.

    upload_2015-8-11_23-2-19.png

    There is still much work to be done before this feature is released but "it is breathing now" :)
     
  40. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is an example using 8 different fonts & materials. This is using the same script as example 11 - Old Computer Terminal that is included with TextMeshPro. I duplicated the object to show one selected.




    It seems that most fonts match each other in terms of alignment and scale. However, there are some where the font designer (I guess) didn't keep that in mind. As a result, I'll be adding a scale property to the Font Asset inspector to allow adjusting fonts like "Arcade.ttf" which is used by the word "of" which is too small.

    This is still work-in-progress but it is taking shape :)
     
  41. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Currently working to make sure Dynamic Text Styling (Dilation, Outline, Shadow, Glow, etc.) works well with the Multi Font & Material support in TextMesh Pro.



    This example uses 4 different fonts which have different settings in terms of outline and shadow.
     
  42. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is another update for tonight.

    As I was working with multiple fonts, it became apparent that I needed to re-work how line spacing is handled. The previous implementation was using fontScale to handle line spacing adjustments steaming for the use of the <size> tag for instance. This worked fine but when using multiple fonts which happen to have been created using different sampling / point size thus resulting in different fontScale for each, the previous implementation didn't work so well.

    Interestingly, the revised implementation which works perfectly with multiple fonts turned out to be simpler and more efficient than the previous one.



    First, this example is using 5 different fonts (one for each letter). I am using the (same unmodified) TMP_TextInfoDebugTool script which is included in the latest release of TextMeshPro to help me visualize the individual characters as well as the Ascender and Descender of each font (in this case represented by a single character). The cyan lines show the Ascender and Descender of each font / character. So instead of using fontScale, I am now using the Ascender and Descender of each character / fonts which takes into consideration the point size / scale anyway.

    As you can see in this GIF animation, word wrapping behaves as expected. You can also see how the lowest Descender of a line and tallest Ascender of the next line determines the line spacing. You see when I adjust the Descender of the first line how it affects the next line and how adjusting the Ascender of the second line also affects the line spacing.

    Once I have a chance, I'll create a video going over all of this. Creating a video will give me an opportunity to further test all of this.
     
  43. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a test of cycling thru 6 different fonts in a text object. Notice how line spacing and word wrapping behaves as expected.



    Thus far this new feature is coming along pretty well. Still lots more work to be done but I am pleased so far :)
     
  44. JFo

    JFo

    Joined:
    Dec 9, 2007
    Posts:
    217
    Hi Stephan,

    We've been using TMPro heavily - it'a a great asset!

    In one scene we get following warning: ""Converting from using anchor and lineLength properties to Text Container."
    Can you point out what might cause that or is there any problems just ignoring it and comment the warning out from code? Everything seems to work as expected, so just wondering...

    BR,
    Juha
     
  45. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The old version of TextMesh Pro (0.1.44) didn't use a RectTransform or Text Container to define the region where the text lived. As a result this lineLength property was used to define the word wrapping length. When the Text Container / RectTransform was introduced in later versions and in Unity 4.6, I switched over to using the area defined by those to control the word wrapping length.

    You are getting this message because you have an object(s) that came over from the previous version which still have a lineLength defined so TextMesh Pro is trying to switch over to the new handling. Most likely those object(s) haven't been saved so every time they are loaded, it keeps converting them. The source object could be a prefab from which you instantiate an object. Since the prefab might not have been modified since the upgrade it might still have this lineLength and thus each object instantiated from it would end up being converted. Without more detail I am guessing as to which scenario is happening here but something like that.

    If you can't easily pinpoint what exactly, I suggest making a post on the TMP user forum and getting me a simple scene / repro so I can take a look and tell you exactly why / what is causing it.
     
  46. JFo

    JFo

    Joined:
    Dec 9, 2007
    Posts:
    217
    Thanks for the fast answer! Yes, you are right. We are using prefabs so I'll update the old references and it should be ok.

    Keep up the good work!
    Juha
     
  47. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Keep me posted on this just in case.

    I will :)
     
  48. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    TMP has errors on Unity 5.2f1. do you have any 5.2 compatible version?
     
  49. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There is a release available on the TextMesh Pro user forum which works. You will need to be a registered user and member of the forum to access it.

    In terms of those errors, they are due to Unity renaming and changing several key functions related to the CanvasRenderer and Masking. The changes also include making a big portion of their previous implementation obsolete.

    Basically, Unity 5.2 will require updates for all those plugins that worked / generated geometry for the CanvasRenderer. There is no real backwards / bridge between previous releases of Unity and Unity 5.2.
     
    Last edited: Aug 21, 2015
  50. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Multi Font & Material Support Preview
    The following video is a preview of the new Multi Font & Material support coming to TextMesh Pro. This is still Work-In-Progress but it is coming along very well.

     
Thread Status:
Not open for further replies.
unityunity