Digital Native Studios

TextMeshPro => Feature Requests => Topic started by: MadMac on November 11, 2015, 02:15:56 AM

Title: Native Emoji Support !!!
Post by: MadMac on November 11, 2015, 02:15:56 AM
Hello,
well i was looking for a native Emoji solution but did not found it in TextMesh Pro.
So here is the request for native emoji support and not inline sprite or something else...
If the User put a emoji in the Text field on Mobile it shut show up... until now i get error...
I can use system font to do that but it's not easy because Unity don't want it...
So plz if possible bring native emoji support in Text Mesh Pro!
many many thx...
M. 8)
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 11, 2015, 08:56:45 PM
Hello,
well i was looking for a native Emoji solution but did not found it in TextMesh Pro.
So here is the request for native emoji support and not inline sprite or something else...
If the User put a emoji in the Text field on Mobile it shut show up... until now i get error...
I can use system font to do that but it's not easy because Unity don't want it...
So plz if possible bring native emoji support in Text Mesh Pro!
many many thx...
M. 8)

Once the Multi Font support is available which will include Fallback fonts and better handling of sprites, I should be able to make the changes necessary so that a Fallback sprite sheet can be also be used. What I need to explore and implement on my end (which some users have already done) is some automated method to extract the native emoji from the device and add them into this default fallback sprite asset.
Title: Re: Native Emoji Support !!!
Post by: AsherVo on April 12, 2016, 10:40:03 AM
I want to resurrect this topic! Emoji support is expected from most modern experiences and Multi Font support is now available!

Any updates on this feature?
Title: Re: Native Emoji Support !!!
Post by: MadMac on July 04, 2016, 10:21:30 PM
bump.

are they any news on this?
many thx
M.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on July 05, 2016, 01:08:21 AM
bump.

are they any news on this?
many thx
M.

I need to investigate how we could get access to the Emoji data contained on the device in order to create a texture and data structure which contains information about each of those sprites in that texture (similar to the Sprite Assets).

If anyone already has code written that can access the sprites on the device to enable use to generate that texture then, adding support for this should be fairly simple.
Title: Re: Native Emoji Support !!!
Post by: Claytonious on September 26, 2016, 04:25:01 PM
Hello! Has there been any progress or thoughts on this? Native emoji support from the iOS/Android keyboard is the last thing keeping us from using TextMeshPro for our in-game chat. Would love to finish switching entirely over to TMPro and dump that native baggage.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on September 27, 2016, 12:57:27 AM
I haven't been able to make much progress lately but did end up indirectly making some progress on this. See the following thread http://digitalnativestudios.com/forum/index.php?topic=1218.msg9213#msg9213

In the case of the thread above, the Font Asset actually contains the Emoji which are mapped in the UTF32 range (which is how this is done on iOS and Android). So when you type the emoji on iOS, they do show up as expected. Although this isn't exactly what we want, it did provide for a way that native emoji support could be added which is as follows.

As a result of that thread, I experimented with using a Sprite Asset as a Fallback for missing characters. So for instance, instead of the missing glyph coming from an Font Asset, a specific Sprite Asset could be used instead where in the event a UTF 32 character is needed (which happens to be an Emoji), the sprite of this Emoji would be used.

In the first implementation of this, a sprite asset could be created which contains all the Emoji used on iOS and Android where each sprite is mapped to the correct UTF 32 unicode value corresponding with that Emoji. Depending on use preference, you could either use the same Sprite Asset for all platforms or use different ones for each platform. In this case, the Sprite Asset and Sprite texture atlas would need to be created and present.

In the second implementation, the Sprite Asset which contains the pre-defined unicode values and coordinates for these Emoji would be pre-created but would not actually be referencing any Sprite Texture Atlas as this referencing would happen at run time based on the device used. I still have to check how to access the texture on iOS or Android that contains those emojis but assuming this is accessible and doesn't change, this should work.
Title: Re: Native Emoji Support !!!
Post by: MadMac on November 13, 2016, 10:41:57 PM
Great News!
well still looking for Emoji in Textmesh...
now it's really time to bring that in...
Want to use text mesh in my next projects... but i need EMOJI support!
plz make us a christmas present ;-)
thx
M.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 16, 2016, 01:18:41 AM
This image may not look like much...

(http://i.imgur.com/tHDk8J8.png)

Until you pay close attention to what characters are being requested.

Here is an image of the Sprite Asset Editor which now includes a new field "Unicode" value for each sprite.

(http://i.imgur.com/aY2swHI.png)

Basically, TextMesh Pro will now be able to use a Sprite Asset as a fallback. So when the requested character is not found in the primary font asset or any of the assigned fallbacks, TMP will now look into the Default Sprite Asset for a sprite with the corresponding Unicode value.
Title: Re: Native Emoji Support !!!
Post by: ggb on November 21, 2016, 11:18:27 PM
This image may not look like much...

(http://i.imgur.com/tHDk8J8.png)

Until you pay close attention to what characters are being requested.

Here is an image of the Sprite Asset Editor which now includes a new field "Unicode" value for each sprite.

(http://i.imgur.com/aY2swHI.png)

Looking great!

Do you have ETA for this feature? We are really looking for it and we should quite soon decide if we start to work with emoji support by our selves or wait for the update.
Basically, TextMesh Pro will now be able to use a Sprite Asset as a fallback. So when the requested character is not found in the primary font asset or any of the assigned fallbacks, TMP will now look into the Default Sprite Asset for a sprite with the corresponding Unicode value.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 23, 2016, 12:42:25 AM
Update
Ran into an issue last night related to a change made by Unity where on iOS, the native TouchScreenKeyboard would filter out UTF32 characters which happens to be the range in which Emojis are mapped. Took me a while to find the relevant information (https://support.unity3d.com/hc/en-us/articles/210338546-How-to-enable-disable-the-filter-out-of-Emojis-on-iOS-device). Having done so, I was able add a new property to the TMP Settings file which overrides this change to make it possible to use Emojis on those devices.

As a result, I am now able to type / use the native touch keyboards to display Emojis on those devices in the Input Field.

I still have an issue on Windows where using the Virtual Keyboard, doesn't produce the correct result due to Unity's Event.currentEvent.character returning ?? char(63) + char(63) instead of the surrogate pair representing the Unicode value of the emoji.

Please note this is not true native support for Emoji but some alternative implementation where a designated Sprite Asset which contains sprites mapped to specific Unicode values are displayed.

At the present time, the Default Sprite Asset assigned in the TMP Settings file is used as a Fallback. As such when the font asset that you are using does not contain a character mapped at U+1F600 (the smiley face), TMP inserts the sprite using this Unicode value instead of the missing glyph (square) symbol. Assuming your Default Sprite Asset contains the same sprites / emoji as what Apple uses, the emojis displayed would look the same.

The downside to using this implementation is that your Default Sprite Asset has to contains those emojis / sprites which is different on Android vs. iOS vs. other devices. I still have to implement some easy way to assign those Unicode values to these sprites. On the flip side, it does provide for the ability to use your own custom Emoji sprites sheet which would ensure the result on consistent from device to device.

Lastly and although I have not had time to explore this, I presume it would be possible to extract the native sprite sheet used on those devices at runtime (when the application is loaded). Given the TMP Sprite Assets reference some texture, the content of the texture could actually change and be assigned at runtime for the given platform. In doing so, the Sprite Asset would contain a pre-defined list of sprite with the proper Unicode assignment and maybe a default (catch all) texture in case the native one cannot be extracted from the device at run time. I won't be able to explore this last part in the near term but this is perhaps something that could be explored by TMP user familiar with those devices and where these native sprite sheets or how this information could be extracted from the devices themselves.
Title: Re: Native Emoji Support !!!
Post by: ggb on November 24, 2016, 02:21:46 AM
Thanks for the info!

We are currently working only on iOS and Android app so Windows phone support is not too important for us. Also we will use same emojis with iOS and Android so extracting native emojis is not necessary.

Do you have any schedule for way to assign Unicode values?
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 24, 2016, 02:49:52 AM
Thanks for the info!

We are currently working only on iOS and Android app so Windows phone support is not too important for us. Also we will use same emojis with iOS and Android so extracting native emojis is not necessary.

Do you have any schedule for way to assign Unicode values?

Right now the assignment of values can be done in the Sprite Asset Inspector which is a manual process. Given the API is exposed, a simple script could be written to set these values but the underlying issue is simply assigning the correct value to the right sprite. Since Unity's Sprite Editor may not always define these sprites in the same order, this simply complicates this process.

I might be a good idea TextMesh Pro to include some Default Sprite Asset which includes the standard Emojis. I just have to find one of those that I can include which is free to distribute. Are you using some custom Emoji Sprite Sheet or some public domain one that i could use?
Title: Re: Native Emoji Support !!!
Post by: ggb on November 24, 2016, 03:03:14 AM
Our current plan is to go with this package: http://emojione.com/developers/
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 24, 2016, 03:31:05 AM
Our current plan is to go with this package: http://emojione.com/developers/

Looks good to me. I'll work with those.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on November 25, 2016, 01:10:51 AM
Looking at EmojiOne, I noticed the file names of the individual sprites (.png) contains the unicode value of those sprites. Given this, I decided to create a Sprite Importer which supports the json data format from Texture Packer which also happens to include the names of the sprites making it easy to create TMP Sprite Assets from sprites packed using Texture Packer and to also have the correct unicode value assigned automatically.

(http://i.imgur.com/OXnfT4W.png)
Title: Re: Native Emoji Support !!!
Post by: ggb on November 27, 2016, 10:49:17 PM
Looks good! Can't wait for the release :)
Title: Re: Native Emoji Support !!!
Post by: MadMac on December 13, 2016, 04:36:23 AM
yes plz a x-mas present plz.
respect!
M.
Title: Re: Native Emoji Support !!!
Post by: ARafay on December 16, 2016, 02:20:27 AM
Hi Stephan, Does this mean we can make chat screens where when user type : ) it becomes :) ?
Title: Re: Native Emoji Support !!!
Post by: Jasper Flick on December 16, 2016, 03:44:18 AM
ASCII smileys are not the same as emoji. You'll have to parse the user input and replace ASCII smileys with sprite tags. This is what chat programs and forums do as well. The bad news is that you have to do that yourself. The good news is that you can already do this.
Title: Re: Native Emoji Support !!!
Post by: ARafay on December 16, 2016, 06:53:10 AM
ASCII smileys are not the same as emoji. You'll have to parse the user input and replace ASCII smileys with sprite tags. This is what chat programs and forums do as well. The bad news is that you have to do that yourself. The good news is that you can already do this.

Thanks,

If thats the case then there is a bug with InputField which doest proerly change caretPosition etc. I hope Stepehan fix it before next beta.
Title: Re: Native Emoji Support !!!
Post by: Jasper Flick on December 16, 2016, 07:28:36 AM
What bug are you referring to? By the way, the replacement I alluded to doesn't affect the text as it is being typed. The : ) becomes a :) after submission, not in the input field.
Title: Re: Native Emoji Support !!!
Post by: MadMac on December 21, 2016, 02:18:07 AM
What bug are you referring to? By the way, the replacement I alluded to doesn't affect the text as it is being typed. The : ) becomes a :) after submission, not in the input field.
Hello Jasper,
thx for chiming in :-)
can you explain how to do that?
or is there a example?
many thx
M.
Title: Re: Native Emoji Support !!!
Post by: Jasper Flick on December 21, 2016, 03:48:13 AM
When the user submits the text they input, you copy it somewhere. Like appending to a chat log. Instead of copying it verbatim, use something like
Code: [Select]
userInput.Replace(":)", "<sprite=1>")
Title: Re: Native Emoji Support !!!
Post by: Claytonious on January 04, 2017, 07:09:13 AM
Sounds like great progress so far. Stephan, your custom importer sounds like what we've done with editor scripts for ourselves, but combined with some ugly hacks to the TMPro source code to do something like the fallback that you mentioned, but in a more brittle way that has side effects on characters in the input field. We would love to throw this away and instead switch to your "official" solution for emoji fallbacks as described here. Do you have any news yet on when that might be released?

Thanks as always!
Title: Re: Native Emoji Support !!!
Post by: BlackCrowGames on January 05, 2017, 03:07:47 AM
Hi,

I tried out the new Emoji support from the latest version 1.0.55.
During my tests I ran into a couple of difficulties that may be clear to others but weren't to me.

Here's what I did:
1. I created a sprite sheet with texture packer and exported it (JSON Array)
2. Used the "Sprite Importer" to get the right Sprite Asset
3. Put that Sprite Asset onto my TextMeshPro Text gameobject at "EXTRA SETTINGS"-"Sprite Asset"

What happened was, that it worked for some emojis - exactly for a total of 16 emojis.
I found out that I needed to change the default Sprite Asset to have all emojis to be displayed upon entering a Unicode-String
It was not possible to just change the sprite Asset on my gameobject to see the correct emoji.
TextmeshPro always uses the default Sprite Asset.

Then I noticed that it is only possible to display single byte emojis. Emojis like this one: https://s-media-cache-ak0.pinimg.com/736x/d8/6a/6f/d86a6f7df850aea258c10dd73bdf3f6c.jpg (https://s-media-cache-ak0.pinimg.com/736x/d8/6a/6f/d86a6f7df850aea258c10dd73bdf3f6c.jpg) can not be displayed.

Will that feature be added and if yes, when?

Thank you for any answer.... :)
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on January 05, 2017, 03:26:07 AM
Hi,

I tried out the new Emoji support from the latest version 1.0.55.
During my tests I ran into a couple of difficulties that may be clear to others but weren't to me.

Here's what I did:
1. I created a sprite sheet with texture packer and exported it (JSON Array)
2. Used the "Sprite Importer" to get the right Sprite Asset
3. Put that Sprite Asset onto my TextMeshPro Text gameobject at "EXTRA SETTINGS"-"Sprite Asset"

What happened was, that it worked for some emojis - exactly for a total of 16 emojis.
I found out that I needed to change the default Sprite Asset to have all emojis to be displayed upon entering a Unicode-String
It was not possible to just change the sprite Asset on my gameobject to see the correct emoji.
TextmeshPro always uses the default Sprite Asset.

Then I noticed that it is only possible to display single byte emojis. Emojis like this one: https://s-media-cache-ak0.pinimg.com/736x/d8/6a/6f/d86a6f7df850aea258c10dd73bdf3f6c.jpg (https://s-media-cache-ak0.pinimg.com/736x/d8/6a/6f/d86a6f7df850aea258c10dd73bdf3f6c.jpg) can not be displayed.

Will that feature be added and if yes, when?

Thank you for any answer.... :)

The current implementation is essentially using a Sprite Asset as a Fallback. So after TMP looks for the emoji unicode in the current font asset and its assigned fallbacks, it then looks thru the Default Sprite Asset. As such, it will only look at the Default Sprite Asset.

I am thinking that it might make sense to add another option to the TMP Settings file which would be to assign a Fallback Sprite Asset which would make it clear that it will be used for Emoji support. Subsequently, I am also thinking of making it possible to assign Fallback Sprite Assets to it as the list of Emoji keeps growing and fitting all of those in a simple texture at 2048 X 2048 is becoming an issue.

In terms of support for multi byte / modifiers and emoji sequence, that is something I have to look into and do plan to add support for.
Title: Re: Native Emoji Support !!!
Post by: mops on February 07, 2017, 12:30:33 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.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on February 07, 2017, 12:44:36 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.
Title: Re: Native Emoji Support !!!
Post by: alexchouls on February 07, 2017, 09:10:33 PM
Where can I get 1.0.55?
Working on a project where emoji support would be very helpful!
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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.
Title: Re: Native Emoji Support !!!
Post by: mops 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?
Title: Re: Native Emoji Support !!!
Post by: Claytonious on February 16, 2017, 12:45:51 PM
Hi, Stephan. Is there any news on the emoji front yet?

Thanks!
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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.
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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?
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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.
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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!!
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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?
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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!
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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?
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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...
Title: Re: Native Emoji Support !!!
Post by: Stephan B. 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.
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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...?
Title: Re: Native Emoji Support !!!
Post by: alexchouls 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.
Title: Re: Native Emoji Support !!!
Post by: alexchouls on February 24, 2017, 02:08:28 PM
OK, figured it out. I have to run the www.text through this function:

Code: [Select]
    string DecodeUTF16(string text)
    {
        return Regex.Replace(
            text,
            @"\\U(?<Value>[a-zA-Z0-9]{8})",
            m => char.ConvertFromUtf32(int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)));
    }
Title: Re: Native Emoji Support !!!
Post by: alexchouls on February 24, 2017, 02:15:00 PM
Is there a way to control the placement of the Emoji?

By default I get this:
[attachimg=1]

When I would want this:
[attachimg=2]

I achieved the latter by manually translating the TMP SubMesh object. But I imagine there's another way? Some kind of Emoji/sprite center setting?
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on February 24, 2017, 02:29:22 PM
Is there a way to control the placement of the Emoji?

By default I get this:
(Attachment Link)

When I would want this:
(Attachment Link)

I achieved the latter by manually translating the TMP SubMesh object. But I imagine there's another way? Some kind of Emoji/sprite center setting?

The position of the sprites is relative to the baseline of the text. So wherever the pivot is located when the sprite is defined in the Unity Sprite Editor determines where the sprite will be initially positioned (again relative to the baseline).

In terms of centering, that would be hard given the Baseline and Ascender and Descender changes per font so if the sprite was defined centered on one font, those same X and Y offset would be different for another font whose Baseline, Ascender and Descender are different. The baseline is consistent in the sense of what it is located. Most letters are sitting on the baseline.

Also note that you can use the Global Adjustment at the bottom of the Sprite Inspector panel to modify all sprites the same way.
Title: Re: Native Emoji Support !!!
Post by: gluphil on March 15, 2017, 03:57:51 PM
Hi Stephan,

We are trying to support the latest emoji available in iOS 10.2 (Unicode 9).

http://emojipedia.org/apple/ios-10.2/

We have built a tool to extract the emoji from a TTF file into a texture atlas and generate a mapping from Unicode character sequences to sprites in the atlas. We then replace the character sequence with an inline image of the sprite.

With the new extended emoji in Unicode 9, what we currently don't have is a way to easily parse through an arbitrary string to easily identify the emoji sequences. Zero Width Joiners and Modifier sequences complicate the parse:

http://unicode.org/emoji/charts/emoji-zwj-sequences.html
http://unicode.org/reports/tr51/#Emoji_Modifiers_Table

Is there a simpler way to handle the full Unicode 9 emoji set in Text Mesh Pro? What is your approach to identifying the emoji in an arbitrary string?

Thank-You
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on March 16, 2017, 12:18:08 AM
Hi Stephan,

We are trying to support the latest emoji available in iOS 10.2 (Unicode 9).

http://emojipedia.org/apple/ios-10.2/

We have built a tool to extract the emoji from a TTF file into a texture atlas and generate a mapping from Unicode character sequences to sprites in the atlas. We then replace the character sequence with an inline image of the sprite.

Are you creating a Sprite Asset where you assign the Unicode to each of those sprite in the Sprite Asset Editor?

Short of the handling of Emoji modifiers and sequences, normal Emojis should just work provided you have the correct Unicode Value assigned to them.

Quote
With the new extended emoji in Unicode 9, what we currently don't have is a way to easily parse through an arbitrary string to easily identify the emoji sequences. Zero Width Joiners and Modifier sequences complicate the parse:

http://unicode.org/emoji/charts/emoji-zwj-sequences.html
http://unicode.org/reports/tr51/#Emoji_Modifiers_Table

Is there a simpler way to handle the full Unicode 9 emoji set in Text Mesh Pro? What is your approach to identifying the emoji in an arbitrary string?

I am still thinking about how to add support for these modifiers and sequences but essentially these are ligatures where  u1F466 +  u1F3FB = new glyph with its own unicode value whose name is the combination of the two. Just like ligatures, 2 of these combine to make a new glyph which combined with others make another.

The font file contains all these ligatures in the gsub table which in the case of the example above is as follows in the font file

sub boy emojimodifierfitzpatricktype1to2 -> boy_emojimodifierfitzpatricktype1to2;

So whenever we get Boy + emojimodifierfitzpatricktype1to2, we replace these two by boy_emojimodifierfitzpatricktype1to2

I don't know if the modifiers are clearly labels as such which would potentially avoid more lookup in the table for finding potential substitutions.






 
Title: Re: Native Emoji Support !!!
Post by: mops on July 18, 2017, 05:55:44 AM
Hi, what about emoji modifiers? Is it still in progress?
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on July 18, 2017, 12:00:54 PM
Hi, what about emoji modifiers? Is it still in progress?

Support for Emoji modifiers is still planned. Most likely this will be in the integrated version of TMP which I am working on. Having said that, if there are opportunities along the way to add some of the new stuff in TextMesh Pro, I will.
Title: Re: Native Emoji Support !!!
Post by: mops on July 20, 2017, 01:33:10 AM
ok, thanks!
Title: Re: Native Emoji Support !!!
Post by: mops on March 01, 2018, 12:50:44 AM
Hi there!
So, are there some news about emoji modifiers?
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on March 01, 2018, 01:09:51 AM
Hi there!
So, are there some news about emoji modifiers?

Nothing yet other than this functionality will be added along with support for OpenType font features like ligatures which is what emoji modifiers are essentially.
Title: Re: Native Emoji Support !!!
Post by: escaper on March 30, 2018, 08:55:13 PM
What is the process for getting emojis to render when taking text from the internet/twitter?

I have text containing emojis which does not display in this forum (raw text from twitter say).  When it's imported into TextMesh Pro, it simply renders squares in place of the emojis.  Is there documentation explaining how to setup the sprites from EmojiOne (or whatever is supported by default)?  There seems to be scatterings of a process in this thread and on the Unity forums, but I don't see anything in the documentation outlining the process for getting emojis to render properly.

Thanks.
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on March 30, 2018, 09:22:38 PM
What is the process for getting emojis to render when taking text from the internet/twitter?

I have text containing emojis which does not display in this forum (raw text from twitter say).  When it's imported into TextMesh Pro, it simply renders squares in place of the emojis.  Is there documentation explaining how to setup the sprites from EmojiOne (or whatever is supported by default)?  There seems to be scatterings of a process in this thread and on the Unity forums, but I don't see anything in the documentation outlining the process for getting emojis to render properly.

Thanks.

The Sprite tag and Sprite Asset creation process is explained in the following video (https://youtu.be/hlatyQC-xIg).

In the case of EmojiOne, you could create your own Texture and then import it in Unity and then use the Sprite Editor to define each of the sprites as per the video above. Alternatively, you could use an external tool like Texture Packager using the JSON Array option to create the Sprite Atlas Texture and then use the Sprite Importer option in the "Window - TextMeshPro - Sprite Importer" menu.

If you choose to use Texture Packer, just start with just a few sprites to get familiar with the process and then you can create a larger collection and or multiple sprite atlas textures and assign those using the Sprite Asset Fallback.
Title: Re: Native Emoji Support !!!
Post by: Jbaker08 on August 27, 2018, 09:13:02 AM
Hi, what about emoji modifiers? Is it still in progress?

Support for Emoji modifiers is still planned. Most likely this will be in the integrated version of TMP which I am working on. Having said that, if there are opportunities along the way to add some of the new stuff in TextMesh Pro, I will.

Stephan,
have you added support for modifiers yet? It's quite annoying since a lot of emojis use modifiers. Especially flag emojis which are completely broken at the moment.

I hope you can help

Thanks
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on September 06, 2018, 03:06:39 PM
Hi, what about emoji modifiers? Is it still in progress?

Support for Emoji modifiers is still planned. Most likely this will be in the integrated version of TMP which I am working on. Having said that, if there are opportunities along the way to add some of the new stuff in TextMesh Pro, I will.

Stephan,
have you added support for modifiers yet? It's quite annoying since a lot of emojis use modifiers. Especially flag emojis which are completely broken at the moment.

I hope you can help

Thanks

I have not but this is part of the new Text Generator which I'll be integrating in TMP after the release of the Dynamic SDF system which is almost ready.

Support for Emoji modifiers is part of OpenType Font Feature support which is one of the core new features of the new Text Generator. I won't have support for all OpenType features out of the gate but planning to have support for Kerning from both the old Kern and GPOS table (used by OTF fonts) and basic ligature support (which is what emoji modifiers are) should be in there.

I don't have an ETA on this but should be able to provide better insight in the new 2 - 3 weeks.
Title: Re: Native Emoji Support !!!
Post by: mops on March 06, 2019, 02:45:06 AM
Any news about modificators? :)
Title: Re: Native Emoji Support !!!
Post by: Stephan B. on March 07, 2019, 04:06:01 PM
Any news about modificators? :)

The core functionality needed to access OpenType Font Features landed in 2019.2. I am now working on the TMP package to add support for Pair Adjustment data which is basically kerning data contained in the GPOS Table. I am also adding support for Ligatures which are contained in the GSUB table and what Emoji modifiers use. Lastly adding support to raster color glyphs from font files (again to fetch those emojis from font files at runtime).

Once the above is released, I'll continue adding support for the remaining OpenType Font Features.
Title: Re: Native Emoji Support !!!
Post by: mops on September 18, 2019, 04:46:48 AM
Any news about?)