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

alexchouls

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

alexchouls

  • Newbie
  • *
  • Posts: 11
Re: Native Emoji Support !!!
« Reply #46 on: February 24, 2017, 02:15:00 PM »
Is there a way to control the placement of the Emoji?

By default I get this:
[ Guests cannot view attachments ]

When I would want this:
[ Guests cannot view attachments ]

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?
« Last Edit: February 24, 2017, 02:21:38 PM by alexchouls »

Stephan B.

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

gluphil

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

Stephan B.

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






 

mops

  • Newbie
  • *
  • Posts: 16
Re: Native Emoji Support !!!
« Reply #50 on: July 18, 2017, 05:55:44 AM »
Hi, what about emoji modifiers? Is it still in progress?

Stephan B.

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

mops

  • Newbie
  • *
  • Posts: 16
Re: Native Emoji Support !!!
« Reply #52 on: July 20, 2017, 01:33:10 AM »
ok, thanks!

mops

  • Newbie
  • *
  • Posts: 16
Re: Native Emoji Support !!!
« Reply #53 on: March 01, 2018, 12:50:44 AM »
Hi there!
So, are there some news about emoji modifiers?

Stephan B.

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

escaper

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

Stephan B.

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

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.

Jbaker08

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

Stephan B.

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

mops

  • Newbie
  • *
  • Posts: 16
Re: Native Emoji Support !!!
« Reply #59 on: March 06, 2019, 02:45:06 AM »
Any news about modificators? :)