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

Stephan B.

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


ggb

  • Newbie
  • *
  • Posts: 9
Re: Native Emoji Support !!!
« Reply #16 on: November 27, 2016, 10:49:17 PM »
Looks good! Can't wait for the release :)

MadMac

  • Newbie
  • *
  • Posts: 8
Re: Native Emoji Support !!!
« Reply #17 on: December 13, 2016, 04:36:23 AM »
yes plz a x-mas present plz.
respect!
M.

ARafay

  • Full Member
  • ***
  • Posts: 133
Re: Native Emoji Support !!!
« Reply #18 on: December 16, 2016, 02:20:27 AM »
Hi Stephan, Does this mean we can make chat screens where when user type : ) it becomes :) ?

Jasper Flick

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 85
Re: Native Emoji Support !!!
« Reply #19 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.

ARafay

  • Full Member
  • ***
  • Posts: 133
Re: Native Emoji Support !!!
« Reply #20 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.

Jasper Flick

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 85
Re: Native Emoji Support !!!
« Reply #21 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.

MadMac

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

Jasper Flick

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 85
Re: Native Emoji Support !!!
« Reply #23 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>")

Claytonious

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

BlackCrowGames

  • Newbie
  • *
  • Posts: 3
Re: Native Emoji Support !!!
« Reply #25 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 can not be displayed.

Will that feature be added and if yes, when?

Thank you for any answer.... :)

Stephan B.

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

mops

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

Stephan B.

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

alexchouls

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