Author Topic: Native Emoji Support !!!  (Read 34147 times)

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #30 on: February 07, 2017, 09:53:52 PM »
Where can I get 1.0.55?
Working on a project where emoji support would be very helpful!

Latest releases are always available in the "TMP - Alpha, Beta and Final Releases" section of the user forum.

mops

  • Newbie
  • *
  • Posts: 16
Re: Native Emoji Support !!!
« Reply #31 on: February 10, 2017, 05:21:08 AM »
Hi, emoji support is that I very expected. Thanks!
I've made sprite asset from emojione and it works. But some emojies incorrect renders. For example, if I type \U0001f93c-1f3fd it will render \U0001f93c and text -1f3fd.

Support for Emoji modifiers isn't implemented yet which is why you are getting this behavior.

Oh, got it. Do you have any plans on it? When it will be realised?

Claytonious

  • Newbie
  • *
  • Posts: 4
Re: Native Emoji Support !!!
« Reply #32 on: February 16, 2017, 12:45:51 PM »
Hi, Stephan. Is there any news on the emoji front yet?

Thanks!

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #33 on: February 16, 2017, 12:50:25 PM »
Hi, Stephan. Is there any news on the emoji front yet?

Thanks!

I am still working on adding support for Emoji modifiers and fallback for emoji so they can be split into multiple Sprite Assets but basic support is already in the current and previous releases available on the user forum.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #34 on: February 16, 2017, 05:01:39 PM »
I just added the ability to add a list of Fallbacks to Sprite Assets. So when searching for a sprite matching a given Unicode value, TMP will be able to search through all these fallbacks.

I added this functionality to make it possible to break up Emoji / Sprites between several Sprite Assets given EmojiOne for instance now has over 1500 sprites which is hard to fit into a 2048 X 2048 texture (which is still the texture limit on many mobile devices). So now you could use several Sprite Asset / Textures to get access to even more Emojis / Unicodes.

Note this functionality only works when using Unicode values coming from Input or UTF16 or UTF32. ie. the <sprite> tag does not use the fallbacks.

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #35 on: February 21, 2017, 01:36:30 PM »
I'm using SetText at runtime with a UTF32 emoji (e.g., \U0001f496) but it shows as "\U0001f496" instead of the emoji.
If I "nudge" it in the editor (e.g. Uncheck "Enable Kerning") the TMP SubMesh gets added and the Emoji displays properly.
What do I need to call at runtime to add the TMP SubMesh after using SetText?

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #36 on: February 21, 2017, 02:07:53 PM »
I'm using SetText at runtime with a UTF32 emoji (e.g., \U0001f496) but it shows as "\U0001f496" instead of the emoji.
If I "nudge" it in the editor (e.g. Uncheck "Enable Kerning") the TMP SubMesh gets added and the Emoji displays properly.
What do I need to call at runtime to add the TMP SubMesh after using SetText?

Let me take a look as this should work.

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #37 on: February 22, 2017, 06:03:31 PM »
I'm using SetText at runtime with a UTF32 emoji (e.g., \U0001f496) but it shows as "\U0001f496" instead of the emoji.
If I "nudge" it in the editor (e.g. Uncheck "Enable Kerning") the TMP SubMesh gets added and the Emoji displays properly.
What do I need to call at runtime to add the TMP SubMesh after using SetText?

Let me take a look as this should work.

Any update on this? Sorry to bump, but submitting an app soon and this is a blocking issue right now... thanks!!

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #38 on: February 22, 2017, 06:46:06 PM »
I'm using SetText at runtime with a UTF32 emoji (e.g., \U0001f496) but it shows as "\U0001f496" instead of the emoji.
If I "nudge" it in the editor (e.g. Uncheck "Enable Kerning") the TMP SubMesh gets added and the Emoji displays properly.
What do I need to call at runtime to add the TMP SubMesh after using SetText?

Let me take a look as this should work.

Any update on this? Sorry to bump, but submitting an app soon and this is a blocking issue right now... thanks!!

You are always and most welcome to bump topics when I fail to reply as I have so much stuff going on that bumping of a thread is actually helpful in most cases.

Using the code below works fine for me and displays the Emoji as expected.

Code: C#
  1. m_TextComponent.SetText("\U0001F60D");
  2.  


I am using the latest release of TMP which is 1.0.55.52.0b5 which was released a few days ago.

What version of TMP are you using?

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #39 on: February 22, 2017, 07:14:17 PM »
I'm using SetText at runtime with a UTF32 emoji (e.g., \U0001f496) but it shows as "\U0001f496" instead of the emoji.
If I "nudge" it in the editor (e.g. Uncheck "Enable Kerning") the TMP SubMesh gets added and the Emoji displays properly.
What do I need to call at runtime to add the TMP SubMesh after using SetText?

Let me take a look as this should work.

Any update on this? Sorry to bump, but submitting an app soon and this is a blocking issue right now... thanks!!

You are always and most welcome to bump topics when I fail to reply as I have so much stuff going on that bumping of a thread is actually helpful in most cases.

Using the code below works fine for me and displays the Emoji as expected.

Code: C#
  1. m_TextComponent.SetText("\U0001F60D");
  2.  


I am using the latest release of TMP which is 1.0.55.52.0b5 which was released a few days ago.

What version of TMP are you using?

Ahh, I'm on beta3 still. I'll try beta 5.

If it makes a difference, I'm immediately disabling the GameObject after using SetText (it's setting up text for later use). But I'll check in b5. Thanks!
« Last Edit: February 22, 2017, 07:17:31 PM by alexchouls »

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #40 on: February 22, 2017, 07:26:18 PM »
I have to leave for Hockey but will check in after to look into this.

I know I made a change related to disabled objects in the last release or the one just before that so that could be the issue. If it still doesn't behave as expected, can you provide me with a simple script that would allow me to repro the behavior?

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #41 on: February 23, 2017, 11:28:47 AM »
I'm still having the issue in b5. I'm using SetText on a prefab instantiated in the scene and then disabled. I'll see if I can repro in a simpler case.
I'm curious what's called in the editor to update and add the submesh gameobject when I tweak a setting? I'd be fine with calling that manually as a workaround for now...

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #42 on: February 23, 2017, 12:04:11 PM »
I'm still having the issue in b5. I'm using SetText on a prefab instantiated in the scene and then disabled. I'll see if I can repro in a simpler case.
I'm curious what's called in the editor to update and add the submesh gameobject when I tweak a setting? I'd be fine with calling that manually as a workaround for now...

When making changes in the Editor, it simply refreshes the text object thus re-updating everything.

I'll test on my end with a prefab and enabling / disabling but a repro scene / project would be great.

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #43 on: February 23, 2017, 12:46:03 PM »
I can't reproduce with a string literal. However I'm getting my text from a WWW request.
If I copy paste the text from the WWW request it works, but if I feed it in directly I need to "nudge" it to work.
I'm guessing it has something to do with the string encoding maybe...?

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #44 on: February 23, 2017, 01:06:11 PM »
Here's a small repro. Create a TextMeshPro - Text GameObject and attach this script:

Code: [Select]
using System.Collections;
using UnityEngine;
using TMPro;

public class GetWWWText : MonoBehaviour
{
IEnumerator Start ()
    {
        var www = new WWW("http://www.hutonggames.com/art/photoartstar/TestEmoji.php");
        yield return www;

    var tmpro = GetComponent<TextMeshPro>();
        tmpro.SetText(www.text);
    }
}

When you play the text will show as "\U0001F60D" until you change a setting in the editor, then it shows the emoji.
« Last Edit: February 23, 2017, 01:08:01 PM by alexchouls »