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

MadMac

  • Newbie
  • *
  • Posts: 8
Native Emoji Support !!!
« 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)

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #1 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.

AsherVo

  • Newbie
  • *
  • Posts: 6
Re: Native Emoji Support !!!
« Reply #2 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?

MadMac

  • Newbie
  • *
  • Posts: 8
Re: Native Emoji Support !!!
« Reply #3 on: July 04, 2016, 10:21:30 PM »
bump.

are they any news on this?
many thx
M.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #4 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.

Claytonious

  • Newbie
  • *
  • Posts: 4
Re: Native Emoji Support !!!
« Reply #5 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.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #6 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.

MadMac

  • Newbie
  • *
  • Posts: 8
Re: Native Emoji Support !!!
« Reply #7 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.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #8 on: November 16, 2016, 01:18:41 AM »
This image may not look like much...



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.



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.
« Last Edit: November 16, 2016, 01:27:58 AM by Stephan B. »

ggb

  • Newbie
  • *
  • Posts: 9
Re: Native Emoji Support !!!
« Reply #9 on: November 21, 2016, 11:18:27 PM »
This image may not look like much...



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.



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.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #10 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. 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.

ggb

  • Newbie
  • *
  • Posts: 9
Re: Native Emoji Support !!!
« Reply #11 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?

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #12 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?
« Last Edit: November 24, 2016, 02:53:06 AM by Stephan B. »

ggb

  • Newbie
  • *
  • Posts: 9
Re: Native Emoji Support !!!
« Reply #13 on: November 24, 2016, 03:03:14 AM »
Our current plan is to go with this package: http://emojione.com/developers/

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: Native Emoji Support !!!
« Reply #14 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.