Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

TextMesh Pro Full Emoji Support Api (emoji Sequen

Discussion in 'UGUI & TextMesh Pro' started by Rafael_CS, Apr 12, 2019.

  1. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Thanks again for the report, i fixed that in version 1.1.1

    Cound you try it again and tell me if it was fixed?
     
    Last edited: Apr 19, 2021
  2. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    179
    Thank you for the fast fix <3 . Yes, emoji 1.1.1 fixed the wrong parsing
    It also worked with the latest verified TMP for 2020 LTS ! (3.0.5)
    upload_2021-4-19_14-3-58.png
     
    Rafael_CS likes this.
  3. odk-mmmm

    odk-mmmm

    Joined:
    May 24, 2017
    Posts:
    3
    Are there any plans to support the TextMeshPro class? (it is used by GameObject/3D Object/Text - TextMeshPro)
     
  4. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Not now, but EmojiSearchEngine contains the method to pre-parse emoji text into valid text to you TextMeshPro 3d object.

    Just use

    TMP_EmojiSearchEngine.ParseEmojiCharSequence(spriteAsset, ref text).

    Now pick the text return and set it into your tmp 3d object
     
    jiraphatK and odk-mmmm like this.
  5. odk-mmmm

    odk-mmmm

    Joined:
    May 24, 2017
    Posts:
    3
    oh great

    I was able to convert the emoji sequence to sprite tags in TextMeshPro class with the following code.

    Thanks for your advice.

    Code (CSharp):
    1.     private void Start()
    2.     {
    3.         var tmp = GetComponent<TextMeshPro>();
    4.  
    5.         using (var sr = new StreamReader("Assets/emoji.txt", Encoding.GetEncoding("utf-8")))
    6.         {
    7.             var emojiText = sr.ReadToEnd();
    8.             TMP_EmojiSearchEngine.ParseEmojiCharSequence(tmp.spriteAsset, ref emojiText);
    9.             tmp.text = emojiText;
    10.             GUIUtility.systemCopyBuffer = emojiText;
    11.         }
    12.     }
     
    Rafael_CS likes this.
  6. manundi

    manundi

    Joined:
    Jun 30, 2019
    Posts:
    10
    This is amazing! I was getting very frustrated with emojis on my project and now I am very close to solve it all with your package. The last problem is that I am building for WebGl. Emojis work on editor but not on Webgl builds. So is there any way of getting it work with the package or is there a way to export a correctly formatted json to use with original TMP sprite asset creator?
     
  7. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Why not working in webgl?

    In theory this package should work regardless of platform selected.

    Please, provide more informations.
     
    Last edited: Apr 22, 2021
  8. manundi

    manundi

    Joined:
    Jun 30, 2019
    Posts:
    10
    Thanks for quick reply! I will continue testing after 8 hours at day job and provide more info. Meanwhile has someone got it working on Webgl? For me it's just squares where emoji should be.
     
  9. manundi

    manundi

    Joined:
    Jun 30, 2019
    Posts:
    10
    I had made a mistake and did not have sprite assets on resources folder. I can confirm this is working for WebGl! Thanks again!
     
    Rafael_CS likes this.
  10. dujimache

    dujimache

    Joined:
    Dec 17, 2011
    Posts:
    89
    any exact plan of supporting EmojiCharSequence???
     
  11. realragnvaldr

    realragnvaldr

    Joined:
    Jul 21, 2019
    Posts:
    40
    Hi Rafael,

    I noticed that some emojis are not working in my Unity app. Here is an example:

    upload_2021-5-4_22-21-17.png

    My questions:
    1) is this due to the my sprite sheet simply not having all emojis?
    2) if so, is there any easy way to solve this (either paid or free)? I've tried different sprite sheets from the github repository that you linked in the first page, but they all have the same issue. I also noticed that those sprite sheets are "Emoji 13.0", while the newest set is "14.x"

    If you have any pointers on this, i'd be grateful if you could share. Thanks! :)
     
  12. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Yeah, you are correct.

    Unfortunally this repository contains sprite from version 13.0 and android upgraded to 14.

    We must wait for repository upgrade unfortunally.
     
    Last edited: May 4, 2021
  13. realragnvaldr

    realragnvaldr

    Joined:
    Jul 21, 2019
    Posts:
    40
    Okay, thanks for the prompt response. Then at least i know that i can stop searching for solutions - and will keep an eye on the repository!
     
  14. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    80
    Just tested it with latest 3.06 and your 1.1.1 - looks fine :)
     
  15. unity_3tkPsqh9qtbrCw

    unity_3tkPsqh9qtbrCw

    Joined:
    Feb 9, 2019
    Posts:
    1
    Hello everyone
    Faced a problem. When trying to enter the smile :smiling_face_with_tear: then the application crashes. Unity 2019.4.16, Emoji version 1.1.1 and TextMeshPro 2.1.16
    The problem was with the previous versions of TM Pro and Smile Plugin too
    Has anyone had similar problems?
     
  16. Dailyalex

    Dailyalex

    Joined:
    Oct 21, 2015
    Posts:
    1
    Hi,

    I am using TMP 2.1.6, Unity 2019.4.11f, Emoji 1.1.1

    Issue about wrong flags was reported some time ago by some guy, but I didn't see that he received an answer.

    When I send 1 flag (e.g. Latvian) from my mobile, it shows like this:
    Screenshot 2021-06-29 at 09.47.41.png

    Also I still facing previously issues such as:
    Screenshot 2021-06-29 at 09.47.55.png

    Screenshot 2021-06-29 at 09.48.10.png

    Does anyone have ideas how to fix this?

    UPDATE: I missed 1 important thing, It's necessary to use TMP_Emoji Text UGUI instead of default TextMeshPro - Text(UI). It's working now like a charm :)

    I will left this post, maybe it will be useful to someone.
     
    Last edited: Jun 29, 2021
  17. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    THE VERSION 1.1.2 OF EMOJI SEARCH IS ALIVE!

    Code (CSharp):
    1. {
    2.     "dependencies": {
    3.         "com.kyub.emojisearch": "https://gitlab-ci-token:zF563oCqvXdJmiDuMShq@gitlab.com/KyubInteractive/kyublibs.git#com.kyub.emojisearch-1.1.2",
    4.         ...
    5.     }
    6. }


    CHANGELOG VERSION 1.1.2
    • Fixed compilation errors in TextMeshPro 2.2.0-preview.1 and TextMeshPro 3.2.0-pre.1

    Enjoy!
     
    Last edited: Sep 8, 2021
    firstuser and jiraphatK like this.
  18. jacobAA

    jacobAA

    Joined:
    Sep 29, 2019
    Posts:
    1
    i try to install the new ver and i have error :
    com.kyub.emojisearch: No 'git' executable was found. Please install Git on your system then restart Unity and Unity Hub
    i have Git installed on my pc.
     
    dawt likes this.
  19. ubik

    ubik

    Joined:
    Aug 20, 2012
    Posts:
    4
    I'm getting an exception when trying to remove an emoji from an input field.
    (The TextComponent of the input field is a TMP_EmojiText, and richtext is enabled).
    I've tried removing rich text editing, which doesn't throw an exception but it only removes 1 letter at a time from the unicode string sequence.

    Are emojis not supported on input fields?

    Code (CSharp):
    1. ArgumentOutOfRangeException: Index and count must refer to a location within the string.
    2. Parameter name: count
    3. System.String.Remove (System.Int32 startIndex, System.Int32 count) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. TMPro.TMP_InputField.Backspace () (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_InputField.cs:2972)
    5. TMPro.TMP_InputField.KeyPressed (UnityEngine.Event evt) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_InputField.cs:1918)
    6. TMPro.TMP_InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_InputField.cs:2155)
    Edit: After manually trying to fix the issue in TMP_InputField (the stringLength property is incorrect for emojis), I'm running into other issues when converting typed emojis to sprites.
    (Entering a smiley ":)" as text should convert into a sprite).

    Here's an example of typing ":):)" (which should become two sprites):
     
    Last edited: Sep 14, 2021
    Ardito92ITA likes this.
  20. igor_rst

    igor_rst

    Joined:
    Apr 20, 2017
    Posts:
    40
    Hi Rafael_CS!
    Thanks for cool package!
    I have some issue when use it in app. Some modifiers doesn't work, but all sprites in sprite asset.
    Will be any update? Or how can I fix it?
    "#" sign is mine, I set it to see invisible characters

    I guess that place works incorrect
    Code (CSharp):
    1. //Not a surrogate and is valid UTF32 (conditions to use char.ConvertFromUtf32 function)
    2.                                     if (intValue > 0x000000 && intValue < 0x10ffff &&
    3.                                         (intValue < 0x00d800 || intValue > 0x00dfff)) {
    4. ...
    because items like "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f" detects as not surrogate. But maybe I wrong
     
    Last edited: Nov 16, 2021
  21. igor_rst

    igor_rst

    Joined:
    Apr 20, 2017
    Posts:
    40
    So, after some time of investigation this issue I found out what's the problem..
    If you have, e.g. Woman Facepalming: Dark Skin Tone, your script will get first Woman Facepalming emoji (without skin modifiers) from lookup table and after that add modifiers characters. Correct way is to check whole emoji name.
    I've refactored search part and make just one script for emoji parse:
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System.IO;
    5. using System.Text;
    6. using System.Text.RegularExpressions;
    7. using TMPro;
    8.  
    9. /// <summary>
    10. /// Help for extented TextMeshProEmojiUGUI to find and parse emoji
    11. /// </summary>
    12. public static class EmojiHelper {
    13.  
    14.     /// <summary>
    15.     /// Pattern for find emoji
    16.     /// </summary>
    17.     private const string PATTERN = @"[#*0-9]\uFE0F?\u20E3|©\uFE0F?|[®\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA]\uFE0F?|[\u231A\u231B]|[\u2328\u23CF]\uFE0F?|[\u23E9-\u23EC]|[\u23ED-\u23EF]\uFE0F?|\u23F0|[\u23F1\u23F2]\uFE0F?|\u23F3|[\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC]\uFE0F?|[\u25FD\u25FE]|[\u2600-\u2604\u260E\u2611]\uFE0F?|[\u2614\u2615]|\u2618\uFE0F?|\u261D(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642]\uFE0F?|[\u2648-\u2653]|[\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E]\uFE0F?|\u267F|\u2692\uFE0F?|\u2693|[\u2694-\u2697\u2699\u269B\u269C\u26A0]\uFE0F?|\u26A1|\u26A7\uFE0F?|[\u26AA\u26AB]|[\u26B0\u26B1]\uFE0F?|[\u26BD\u26BE\u26C4\u26C5]|\u26C8\uFE0F?|\u26CE|[\u26CF\u26D1\u26D3]\uFE0F?|\u26D4|\u26E9\uFE0F?|\u26EA|[\u26F0\u26F1]\uFE0F?|[\u26F2\u26F3]|\u26F4\uFE0F?|\u26F5|[\u26F7\u26F8]\uFE0F?|\u26F9(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?|\uFE0F(?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\u26FA\u26FD]|\u2702\uFE0F?|\u2705|[\u2708\u2709]\uFE0F?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|\u270F\uFE0F?|[\u2712\u2714\u2716\u271D\u2721]\uFE0F?|\u2728|[\u2733\u2734\u2744\u2747]\uFE0F?|[\u274C\u274E\u2753-\u2755\u2757]|\u2763\uFE0F?|\u2764(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uFE0F(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?)?|[\u2795-\u2797]|\u27A1\uFE0F?|[\u27B0\u27BF]|[\u2934\u2935\u2B05-\u2B07]\uFE0F?|[\u2B1B\u2B1C\u2B50\u2B55]|[\u3030\u303D\u3297\u3299]\uFE0F?|\uD83C(?:[\uDC04\uDCCF]|[\uDD70\uDD71\uDD7E\uDD7F]\uFE0F?|[\uDD8E\uDD91-\uDD9A]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDE01|\uDE02\uFE0F?|[\uDE1A\uDE2F\uDE32-\uDE36]|\uDE37\uFE0F?|[\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20]|[\uDF21\uDF24-\uDF2C]\uFE0F?|[\uDF2D-\uDF35]|\uDF36\uFE0F?|[\uDF37-\uDF7C]|\uDF7D\uFE0F?|[\uDF7E-\uDF84]|\uDF85(?:\uD83C[\uDFFB-\uDFFF])?|[\uDF86-\uDF93]|[\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F]\uFE0F?|[\uDFA0-\uDFC1]|\uDFC2(?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDFC5\uDFC6]|\uDFC7(?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC8\uDFC9]|\uDFCA(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDFCB\uDFCC](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?|\uFE0F(?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDFCD\uDFCE]\uFE0F?|[\uDFCF-\uDFD3]|[\uDFD4-\uDFDF]\uFE0F?|[\uDFE0-\uDFF0]|\uDFF3(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08)|\uFE0F(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?)?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?|[\uDFF5\uDFF7]\uFE0F?|[\uDFF8-\uDFFF])|\uD83D(?:[\uDC00-\uDC07]|\uDC08(?:\u200D\u2B1B)?|[\uDC09-\uDC14]|\uDC15(?:\u200D\uD83E\uDDBA)?|[\uDC16-\uDC3A]|\uDC3B(?:\u200D\u2744\uFE0F?)?|[\uDC3C-\uDC3E]|\uDC3F\uFE0F?|\uDC40|\uDC41(?:\u200D\uD83D\uDDE8\uFE0F?|\uFE0F(?:\u200D\uD83D\uDDE8\uFE0F?)?)?|[\uDC42\uDC43](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC44\uDC45]|[\uDC46-\uDC50](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC51-\uDC65]|[\uDC66\uDC67](?:\uD83C[\uDFFB-\uDFFF])?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF]|\uDC8B\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF]|\uDC8B\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF]|\uDC8B\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF]|\uDC8B\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF]|\uDC8B\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?))?|\uDC6A|[\uDC6B-\uDC6D](?:\uD83C[\uDFFB-\uDFFF])?|\uDC6E(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDC70\uDC71](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDC72(?:\uD83C[\uDFFB-\uDFFF])?|\uDC73(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDC74-\uDC76](?:\uD83C[\uDFFB-\uDFFF])?|\uDC77(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDC78(?:\uD83C[\uDFFB-\uDFFF])?|[\uDC79-\uDC7B]|\uDC7C(?:\uD83C[\uDFFB-\uDFFF])?|[\uDC7D-\uDC80]|[\uDC81\uDC82](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDC83(?:\uD83C[\uDFFB-\uDFFF])?|\uDC84|\uDC85(?:\uD83C[\uDFFB-\uDFFF])?|[\uDC86\uDC87](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDC88-\uDC8E]|\uDC8F(?:\uD83C[\uDFFB-\uDFFF])?|\uDC90|\uDC91(?:\uD83C[\uDFFB-\uDFFF])?|[\uDC92-\uDCA9]|\uDCAA(?:\uD83C[\uDFFB-\uDFFF])?|[\uDCAB-\uDCFC]|\uDCFD\uFE0F?|[\uDCFF-\uDD3D]|[\uDD49\uDD4A]\uFE0F?|[\uDD4B-\uDD4E\uDD50-\uDD67]|[\uDD6F\uDD70\uDD73]\uFE0F?|\uDD74(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|\uDD75(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?|\uFE0F(?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDD76-\uDD79]\uFE0F?|\uDD7A(?:\uD83C[\uDFFB-\uDFFF])?|[\uDD87\uDD8A-\uDD8D]\uFE0F?|\uDD90(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDD95\uDD96](?:\uD83C[\uDFFB-\uDFFF])?|\uDDA4|[\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA]\uFE0F?|[\uDDFB-\uDE2D]|\uDE2E(?:\u200D\uD83D\uDCA8)?|[\uDE2F-\uDE34]|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|[\uDE37-\uDE44]|[\uDE45-\uDE47](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDE48-\uDE4A]|\uDE4B(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDE4C(?:\uD83C[\uDFFB-\uDFFF])?|[\uDE4D\uDE4E](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDE4F(?:\uD83C[\uDFFB-\uDFFF])?|[\uDE80-\uDEA2]|\uDEA3(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDEA4-\uDEB3]|[\uDEB4-\uDEB6](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDEB7-\uDEBF]|\uDEC0(?:\uD83C[\uDFFB-\uDFFF])?|[\uDEC1-\uDEC5]|\uDECB\uFE0F?|\uDECC(?:\uD83C[\uDFFB-\uDFFF])?|[\uDECD-\uDECF]\uFE0F?|[\uDED0-\uDED2\uDED5-\uDED7]|[\uDEE0-\uDEE5\uDEE9]\uFE0F?|[\uDEEB\uDEEC]|[\uDEF0\uDEF3]\uFE0F?|[\uDEF4-\uDEFC\uDFE0-\uDFEB])|\uD83E(?:\uDD0C(?:\uD83C[\uDFFB-\uDFFF])?|[\uDD0D\uDD0E]|\uDD0F(?:\uD83C[\uDFFB-\uDFFF])?|[\uDD10-\uDD17]|[\uDD18-\uDD1C](?:\uD83C[\uDFFB-\uDFFF])?|\uDD1D|[\uDD1E\uDD1F](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD20-\uDD25]|\uDD26(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDD27-\uDD2F]|[\uDD30-\uDD34](?:\uD83C[\uDFFB-\uDFFF])?|\uDD35(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDD36(?:\uD83C[\uDFFB-\uDFFF])?|[\uDD37-\uDD39](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDD3A|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD3D\uDD3E](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDD3F-\uDD45\uDD47-\uDD76]|\uDD77(?:\uD83C[\uDFFB-\uDFFF])?|[\uDD78\uDD7A-\uDDB4]|[\uDDB5\uDDB6](?:\uD83C[\uDFFB-\uDFFF])?|\uDDB7|[\uDDB8\uDDB9](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDDBA|\uDDBB(?:\uD83C[\uDFFB-\uDFFF])?|[\uDDBC-\uDDCB]|[\uDDCD-\uDDCF](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDDD0|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1|[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|[\uDDAF-\uDDB3\uDDBC\uDDBD])))?))?|[\uDDD2\uDDD3](?:\uD83C[\uDFFB-\uDFFF])?|\uDDD4(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|\uDDD5(?:\uD83C[\uDFFB-\uDFFF])?|[\uDDD6-\uDDDD](?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF](?:\u200D[\u2640\u2642]\uFE0F?)?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])";
    18.  
    19.     /// <summary>
    20.     /// Mask for insert emoji sprite
    21.     /// </summary>
    22.     private const string SPRITE_MASK = "<sprite name=\"{0}\">";
    23.  
    24.     /// <summary>
    25.     /// Draw selector
    26.     /// </summary>
    27.     private const string DRAW_SELECTOR = "fe0f";
    28.  
    29.     /// <summary>
    30.     /// Null space sign
    31.     /// </summary>
    32.     private const string NULL_SPACE = "200d";
    33.  
    34.     /// <summary>
    35.     /// Dict with surrogate names
    36.     /// </summary>
    37.     static Dictionary<int, string> _emojiLookupTable = new Dictionary<int, string>();
    38.  
    39.     /// <summary>
    40.     /// Flag to check updatable
    41.     /// </summary>
    42.     static bool _isUpdated = false;
    43.  
    44.     /// <summary>
    45.     /// Try parse text converting to supported EmojiSequence format (all char sequences will be replaced to <sprite=name>)
    46.     /// </summary>
    47.     public static string ParseEmojiSequence(string text) {
    48.         UpdateLookupTable();
    49.         if (!string.IsNullOrEmpty(text)) {
    50.             MatchCollection matches = Regex.Matches(text, PATTERN);
    51.             StringBuilder sequence = new StringBuilder();
    52.             if (matches.Count > 0) {
    53.                 string result = text;
    54.                 int offset = 0;
    55.                 foreach (Match item in matches) {
    56.                     int index = item.Groups[0].Index + offset;
    57.                     int lenght = item.Groups[0].Value.Length;
    58.                     byte[] data = Encoding.UTF32.GetBytes(item.Groups[0].Value);
    59.                     for (int i = 0; i < data.Length; i += 4) {
    60.                         string part = BitConverter.ToInt32(data, i).ToString("x2");
    61.                         if (!part.Equals(NULL_SPACE) && !part.Equals(DRAW_SELECTOR)) {
    62.                             if (i != 0) {
    63.                                 sequence.Append('-');
    64.                             }
    65.                             sequence.Append(part);
    66.                         }
    67.                     }
    68.                     string emoji = BuildNameInEmojiFormat(sequence.ToString());
    69.                     sequence.Clear();
    70.                     int code = emoji.GetHashCode();
    71.                     if (_emojiLookupTable.ContainsKey(code)) {
    72.                         sequence.Append(result.Substring(0, index));
    73.                         string sprite = string.Format(SPRITE_MASK, _emojiLookupTable[code]);
    74.                         offset += sprite.Length - lenght;
    75.                         sequence.Append(Regex.Replace(result.Substring(index, lenght), PATTERN, sprite));
    76.                         sequence.Append(result.Substring(index + lenght));
    77.                         result = sequence.ToString();
    78.                     }
    79.                     sequence.Clear();
    80.                 }
    81.                 return result;
    82.             } else {
    83.                 return text;
    84.             }
    85.         }
    86.         return text;
    87.     }
    88.  
    89.     /// <summary>
    90.     /// Check emoji in text and convert it to sprite
    91.     /// </summary>
    92.     /// <param name="input">TMP text</param>
    93.     /// <param name="text">Text to parse</param>
    94.     public static void CheckAndParseEmoji(this TextMeshProUGUI input, string text) {
    95.         try {
    96.             input.text = ParseEmojiSequence(text);
    97.         } catch (Exception e) {
    98. #if CLIENT_DEBUG
    99.             Logger.Error(string.Format("Fail on parse emoji string = {0}, error = {1}", text, e.Message));
    100. #endif
    101.         }
    102.     }
    103.  
    104.     /// <summary>
    105.     /// Cache all hashed in a lookuptable
    106.     /// </summary>
    107.     /// <param name="isForseUpdate">Update lookup table</param>
    108.     /// <returns></returns>
    109.     public static bool UpdateLookupTable(bool isForseUpdate = false) {
    110.         if (_isUpdated && !isForseUpdate) {
    111.             return true;
    112.         }
    113. #if CLIENT_DEBUG
    114.         Logger.Info("Update emoji lookup table");
    115. #endif    
    116.         _isUpdated = true;
    117.         List<TMP_SpriteAsset> spriteAssetsChecked = new List<TMP_SpriteAsset>();
    118.         spriteAssetsChecked.Add(TMP_Settings.defaultSpriteAsset);
    119.         for (int i = 0; i < spriteAssetsChecked.Count; i++) {
    120.             TMP_SpriteAsset checkedSpriteAsset = spriteAssetsChecked[i];
    121.             if (checkedSpriteAsset != null) {
    122.                 for (int j = 0; j < checkedSpriteAsset.spriteCharacterTable.Count; j++) {
    123.                     TMP_SpriteCharacter item = checkedSpriteAsset.spriteCharacterTable[j];
    124.                     if (item == null || string.IsNullOrEmpty(item.name)) {
    125.                         continue;
    126.                     }
    127.                     string itemName = BuildNameInEmojiFormat(item.name);
    128.                     int hash = itemName.GetHashCode();
    129.                     if (!_emojiLookupTable.ContainsKey(hash)) {
    130.                         _emojiLookupTable[hash] = item.name;
    131.                     }
    132.                 }
    133.                 for (int k = checkedSpriteAsset.fallbackSpriteAssets.Count - 1; k >= 0; k--) {
    134.                     TMP_SpriteAsset fallback = checkedSpriteAsset.fallbackSpriteAssets[k];
    135.                     if (fallback != null && !spriteAssetsChecked.Contains(fallback)) {
    136.                         spriteAssetsChecked.Insert(i + 1, fallback);
    137.                     }
    138.                 }
    139.             }
    140.         }
    141.         return true;
    142.  
    143.     }
    144.  
    145.     /// <summary>
    146.     /// Clear caches
    147.     /// </summary>
    148.     public static void ClearCache() {
    149. #if CLIENT_DEBUG
    150.         Logger.Info("Clear emoji lookup cache");
    151. #endif            
    152.         _emojiLookupTable.Clear();
    153.         _isUpdated = false;
    154.     }
    155.  
    156.     /// <summary>
    157.     /// Make name for emoji in format
    158.     /// </summary>
    159.     /// <param name="name">Current name</param>
    160.     /// <returns>Updated name</returns>
    161.     public static string BuildNameInEmojiFormat(string name) {
    162.         if (string.IsNullOrEmpty(name)) {
    163.             name = "";
    164.         }
    165.         string fileName = Path.GetFileNameWithoutExtension(name).ToLower();
    166.         char[] splitter = new char[] { '-' };
    167.         if (fileName.Contains("-")) {
    168.             string[] splitArray = fileName.Split(splitter, System.StringSplitOptions.RemoveEmptyEntries);
    169.             fileName = "";
    170.             for (int i = 0; i < splitArray.Length; i++) {
    171.                 string split = splitArray[i];
    172.                 while (split.Length < 8) {
    173.                     split = "0" + split;
    174.                 }
    175.                 fileName += split;
    176.             }
    177.         }
    178.         return fileName;
    179.     }
    180. }
    Now all emojis parse correctly
     
    takatori_unity and firstuser like this.
  22. Sushantha_SV

    Sushantha_SV

    Joined:
    Feb 10, 2019
    Posts:
    10

    Hi ,

    I really appreciate the emoji extension plug-in. which is magically maps the emoji's and handy to use in all platforms.

    There was an issue I'm facing using the same extension. I have followed all the steps mentioned. But I'm having following issue.

    In some android devices for specific emoji's an extra box will getting added. the same discussion of adding extra box is discussed, ( here ) the solution of the discussion din't worked in my case. Please find attached image

    In IOS also the same behaviour observed.

    example:
    Lets say Devices A and B using an emoji X in Chat system. the scenario is happening.
    • Case 1 : In device - A emoji X representation is proper. when it is sent to Device-B the same X representation is showing an additional box along
    • Case 2 : In Device - B emoji X is represented along with box, which is sent to Device - A , now the same emoji is represented along with box. But when Device - A types the same emoji and sent, Device a representation is proper.

    Please let me know any inputs on the issue

    Best regards.
     

    Attached Files:

  23. brikim13

    brikim13

    Joined:
    Jul 11, 2020
    Posts:
    4
    I am not really understanding how to download your package. Where is the repo? What is the repo address?
     
  24. brikim13

    brikim13

    Joined:
    Jul 11, 2020
    Posts:
    4
    Nevermind, I see now. I need to open manifest.json in Packages folder and add this line directly. I never added packages like this before so I was confused
     
  25. andre-summit

    andre-summit

    Joined:
    Nov 10, 2020
    Posts:
    6
    @Rafael_CS Hi, first of all, this asset is very appreciated, it's been a feature lacking in Unity for a long time!

    We have found some issues with input fields using TMP_EmojiTextUGUI:
    • When deleting an emoji with a skin tone (probably any with a unicode sequence), the first delete turns the emoji into the same emoji but without a skin tone, the second delete is the one that actually deletes the emoji.
    • The caret is not displayed at the correct position when adding skin tone emojis. The caret remains after the first emoji with a skin tone (probably any with unicode sequences).
    Would be nice if you could point out how to fix these issues or provide an update. Thanks!
     
    bruceChan123 and Ardito92ITA like this.
  26. Ardito92ITA

    Ardito92ITA

    Joined:
    Apr 1, 2014
    Posts:
    33
    @Rafael_CS Thanks for the package, this resource is highly regarded and well done! <3

    I get an error when I try to delete a flag:

    Code (CSharp):
    1. ArgumentOutOfRangeException: Index and count must refer to a location within the string.
    2. Parameter name: count
    Edit:
    I solved it by activating the "Allow Rich Text Editing" item in the "TextMeshPro - InputField" component, but now when I delete a flag, another flag ticks me and at the second deletion it is deleted.

    This bug is only in unity editor, in android version it works fine!!
     
    Last edited: Apr 10, 2022
    Yennny likes this.
  27. remingtonchan

    remingtonchan

    Joined:
    May 10, 2013
    Posts:
    4
    Hi! I believe the link used for the dependency has suddenly stopped working. Maybe within the last 24 hours. Would you be open to having this hosted over at OpenUPM? :D
     
    ageana likes this.
  28. PhilipRKK

    PhilipRKK

    Joined:
    Nov 22, 2019
    Posts:
    1
    @Rafael_CS When trying to import the package the way you have described I get this error:
    upload_2022-4-11_11-53-28.png

    This definitely did not use to happen, so I'm assuming it's a very recent issue. Is the token expired?
     
  29. Mystic_Quest

    Mystic_Quest

    Joined:
    Feb 22, 2016
    Posts:
    47
    Confirming this :/
     
  30. ageana

    ageana

    Joined:
    Nov 6, 2013
    Posts:
    31
    Same here. I used the cached version until it starts working again.
     
  31. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Buddy, that's not a bug from EmojiSearch itself.

    OnScreenKeyboard (native ones from mobile) know how to handle with emoji sequences and understand that multiple characters represent a single simbol.

    In default unity inputfield there's no knowledge about two characters representing a single emoji.. that's why you need to "delete" multiple chars before completely vanish characters

    This API doesn't have the intent to fix Unity/TMP default input field... i just implemented the text component to visualize/ be able to access emojis on all platforms.
     
  32. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Thanks for Report

    Fixed upgrading to new access token.

    Code (CSharp):
    1. "com.kyub.emojisearch": "https://gitlab-ci-token:glpat-c6ymx9eBXkdQhFhCMaLg@gitlab.com/KyubInteractive/kyublibs.git#com.kyub.emojisearch-1.1.2"
    @PhilipRKK @ageana @Mystic_Quest @remingtonchan
     
  33. raphael_NS

    raphael_NS

    Joined:
    Dec 22, 2020
    Posts:
    5
    Hey @Rafael_CS I'm having problems to download the project.

    Code (CSharp):
    1. An error occurred while resolving packages:
    2. 71  Project has invalid dependencies:
    3. 72    com.kyub.emojisearch: Error when executing git command. error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
    4. 73    error: 50726 bytes of body are still expected
    5. 74    fetch-pack: unexpected disconnect while reading sideband packet
    6. 75    fatal: early EOF
    7. 76    fatal: fetch-pack: invalid index-pack output
    8. 77A re-import of the project may be required to fix the issue or a manual modification of /Users/unityci/builds/1/mobile/unity-clients/buraco/Packages/manifest.json file.
    This is not the first time that this happen. There is not a better way to give us access to the project than using token?
     
  34. Ardito92ITA

    Ardito92ITA

    Joined:
    Apr 1, 2014
    Posts:
    33
    @Rafael_CS This is best solution of the whole web !! I have updated without problems, thanks friend <3 I love you <3
     
    Rafael_CS likes this.
  35. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    47
    i am using latest one "sheet_google_32" but i am trying to pack asset with 1 padding but latest one is not pack correctly. old once is pack correctly but some emoji not supported.
    so please check latest once and give solution as soon as possible.
    also i have attached old and latest screenshot please check
     

    Attached Files:

    • s4.PNG
      s4.PNG
      File size:
      268 KB
      Views:
      143
    • s5.PNG
      s5.PNG
      File size:
      139.2 KB
      Views:
      161
  36. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    @Riken_rds, new Emoji sheet with 32x32 have image size of 2072x2072.. it will overflow the power of two size of unity for 2048x2048.

    you have two options.. change texture option to Non-PowerOfTwo... or edit image in photoshop to have size of 4098x4098 (in this case i recommend you to use 64x64 spritesheet from repository, as the size of Atlas is smaller than 4098x4098).

    If you really need to fill 2048x2048 image you need to use Emoji20 or Emoji16.

    Use tutorial in link below to understand how to create your own sprite atlas from non-power of two sheets:

    https://forum.unity.com/threads/full-emoji-support-api-emoji-sequen.660310/#post-5177240

    PS: the size of Non-Power of Two 2072x2072 texture (in memory) will be greater than 4096x4096 Power of two Compressed texture, so, i recommend use SpriteSheet64 instead 32... or move to SpriteSheet20...
     
    Last edited: Jun 19, 2022
  37. betakyros

    betakyros

    Joined:
    Feb 16, 2014
    Posts:
    1
    Hi Raf, this plugin is awesome! Thanks!

    I have 3 questions.

    1. ̶I̶ ̶w̶a̶s̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶u̶p̶d̶a̶t̶e̶ ̶t̶o̶ ̶E̶m̶o̶j̶i̶ ̶v̶1̶4̶ ̶u̶s̶i̶n̶g̶ ̶t̶h̶e̶ ̶s̶p̶r̶i̶t̶e̶ ̶i̶m̶p̶o̶r̶t̶e̶r̶.̶ ̶I̶'̶m̶ ̶n̶o̶t̶ ̶s̶u̶r̶e̶ ̶w̶h̶a̶t̶ ̶I̶'̶m̶ ̶d̶o̶i̶n̶g̶ ̶w̶r̶o̶n̶g̶.̶ ̶C̶o̶u̶l̶d̶ ̶y̶o̶u̶ ̶g̶i̶v̶e̶ ̶m̶e̶ ̶s̶o̶m̶e̶ ̶g̶u̶i̶d̶a̶n̶c̶e̶?̶ ̶I̶ ̶b̶e̶l̶i̶e̶v̶e̶ ̶I̶ ̶u̶s̶e̶d̶ ̶t̶h̶e̶ ̶c̶o̶r̶r̶e̶c̶t̶ ̶f̶i̶l̶e̶s̶ ̶a̶n̶d̶ ̶t̶h̶e̶ ̶c̶o̶r̶r̶e̶c̶t̶ ̶s̶e̶t̶t̶i̶n̶g̶s̶.̶ ̶H̶o̶w̶e̶v̶e̶r̶ ̶m̶y̶ ̶s̶p̶r̶i̶t̶e̶ ̶s̶h̶e̶e̶t̶ ̶s̶t̶i̶l̶l̶ ̶o̶f̶f̶.̶ ̶I̶ ̶t̶r̶i̶e̶d̶ ̶u̶s̶i̶n̶g̶ ̶a̶ ̶v̶a̶r̶i̶e̶t̶y̶ ̶o̶f̶ ̶o̶t̶h̶e̶r̶ ̶v̶a̶l̶u̶e̶s̶ ̶b̶u̶t̶ ̶n̶o̶n̶e̶ ̶o̶f̶ ̶t̶h̶e̶m̶ ̶q̶u̶i̶t̶e̶ ̶l̶i̶n̶e̶d̶ ̶u̶p̶

    Edit: I figured this out. This was the power of two problem that is solved in the post literally above mine. Resizing the image to 4096x4096 and using the sheet_google_64.png in photoshop solved my problem. Leaving the picture here in case it helps someone else debug their problem.
    upload_2022-6-19_10-27-12.png

    2. A feature I was hoping to implement was download this file on starup of my game and generate the spritesheet. That way I won't have to manually update my emojis when new versions come out. Do you think this is possible?

    3. I was trying to see if the user would ever submit an unsupported emoji. I was looking at this file to see if I could generate a friendly error message when an unsupported emoji was provided. However it seems if an unsupported emoji (like from emoji v14) is submitted, EmojiSearchEngine doesn't recognize the sequence has a v14 emoji and does nothing. Do you have a recommendation about how to identify "unsupported" emojis? upload_2022-6-19_10-29-44.png
     
    Last edited: Jun 19, 2022
  38. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    2. A feature I was hoping to implement was download this file on starup of my game and generate the spritesheet. That way I won't have to manually update my emojis when new versions come out. Do you think this is possible?

    A: You can use Addressables to download any unity asset... just generate an Addressable from 'EmojiData_google_apple' and implement your own logic to apply it to texmesh after download.

    3. I was trying to see if the user would ever submit an unsupported emoji. I was looking at this file to see if I could generate a friendly error message when an unsupported emoji was provided. However it seems if an unsupported emoji (like from emoji v14) is submitted, EmojiSearchEngine doesn't recognize the sequence has a v14 emoji and does nothing. Do you have a recommendation about how to identify "unsupported" emojis?

    A: No, it's not possible. Every character in a text is valid (it's only up to the font used)
    It's not possible to detect missing char sequences.
     
  39. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    47
    thank you for your support
    can you please update all sprite sheet into POT?
    for example : sheet_google_32 size is 2074*2074 using 16.4MB but you set and proper convert into 2048*2048 then size under 5MB.
    so if possible to update all sprite sheet so it's work correctly and use less size.
     
  40. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    47
    I am waiting for you replay
     
  41. CR-DD-N207

    CR-DD-N207

    Joined:
    Jul 16, 2021
    Posts:
    1
    Hi Rafael, thanks for this amazing package. I just had a quick question regarding TMP Settings and Android/iOS overrides for emoji assets created with the Sprite Emoji Importer.

    I have 2 sprite sheets, one for google and one for apple, and I can see that both are being loaded and included in builds of my app via build logs. However, it doesn't actually appear that the override defined sprite sheet is being used. Whether I build for Android or for Apple it always uses my google emojis, not my apple ones.

    Is this a bug? Or have I set this up incorrectly? For reference, here are my Unity and TMP versions:
    Unity - 2019.4.17f1
    TMP - 2.1.1
    Emoji Search - 1.1.2

    Edit: I believe the problem lies in TMP_EmojiSpriteAsset.cs, where the override definitions aren't being set correctly? Or maybe that they aren't being used? Forcibly changing the defaultSpriteAsset doesn't do anything.
     
    Last edited: Jun 28, 2022
  42. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    47
    please give me replay as soon as possible
     
  43. Aelcyx

    Aelcyx

    Joined:
    Jun 13, 2014
    Posts:
    11
    This does seem to exist anymore. gitlab.com/KyubInteractive/kyublibs.git is not a valid repository. Has it moved? Should we use https://github.com/chromee/FullEmojiSupportApi as a substitute?
     
  44. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    yes.. seems to be a bug, overridden option seems to be broken

    i made some changes trying to fix the problem.

    Version 1.1.5
     
    Last edited: Jul 22, 2022
    CR-DD-N207 likes this.
  45. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    VERSION 1.1.5 is Alive

    * Fixed compiler errors with textmeshpro 3.2.0-pre-3 and 2.2.0-preview-3
    * Included emojidata 14.0 asset
    * Attempt to fix Override Android/IOS in EmojiSpriteAsset

    Code (CSharp):
    1. {
    2.     "dependencies": {
    3.         "com.kyub.emojisearch": "https://gitlab-ci-token:glpat-c6ymx9eBXkdQhFhCMaLg@gitlab.com/KyubInteractive/kyublibs.git#com.kyub.emojisearch-1.1.5",
    4.         ...
    5.     }
    6. }
     
    CR-DD-N207 likes this.
  46. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    47
    could you please send me version 1.1.5 link
     
  47. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    1. Install git client on your computer
    2. Open Unity Package manager and select upload_2022-7-22_17-12-24.png

    and add link below
    Code (CSharp):
    1. https://gitlab-ci-token:glpat-c6ymx9eBXkdQhFhCMaLg@gitlab.com/KyubInteractive/kyublibs.git#com.kyub.emojisearch-1.1.5
     
  48. aeixzhu

    aeixzhu

    Joined:
    Mar 17, 2020
    Posts:
    1
    It looks like the gitlab-ci-token has expired.
     
    Last edited: Aug 5, 2022
  49. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    157
    Tested it right now and still working
    Code (CSharp):
    1. https://gitlab-ci-token:glpat-c6ymx9eBXkdQhFhCMaLg@gitlab.com/KyubInteractive/kyublibs.git#com.kyub.emojisearch-1.1.5
     
    Last edited: Aug 11, 2022
    BetaMark likes this.
  50. BetaMark

    BetaMark

    Joined:
    Sep 27, 2014
    Posts:
    208
unityunity