Search Unity

Question Unicode not filled when using TMP Sprite Importer

Discussion in 'UGUI & TextMesh Pro' started by mlafrenaye, Jun 30, 2021.

  1. mlafrenaye

    mlafrenaye

    Joined:
    Jan 25, 2021
    Posts:
    4
    Hi,

    I have been trying to import emoji's to my Unity project. I use Texture Packer version 5.5 with the complete Emoji One package from the website suggest by Unity (3500 emojis). I tried with 80 emoji's first, and created a JSON array and here are my configs :

    upload_2021-6-30_10-23-34.png

    Then, I imported it to unity with the sprite sheet and created the Sprite Asset and it created my 86 emojis :

    upload_2021-6-30_10-25-44.png

    BUT EVERYTIME, the Unicodes are all filled with the default unicode (0xFFFE), and the names contains the Unicode. So the emoji don't work in my project unless I copy the name inside the Unicode by hand (which is ridiculous for 3500 emojis). Note that it works if I use the tag <sprite index = 1...etc> in a TMP text, but this is not what I want.

    upload_2021-6-30_10-30-3.png

    I have attached my JSON array file (had to change it to .txt to attach it). It looks completely fine.
    I have read that it is supposed to automatically be filled with the name in the JSON array. But it is not.
    Is there anyway to make the Unicode value to have automatically the same value has the name ????

    Thanks!
     

    Attached Files:

    Last edited: Jun 30, 2021
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Just ran into your post today while searching for posts about the Sprite Importer. Sorry about that ...

    In the current releases, the sprite filename is used to populate the sprite names but does not populate the unicode code point for these sprites.

    Having said that, I did add a new option to the Sprite Importer to also use the same filename to populate the sprites' Unicode code point as seen below.

    upload_2021-8-18_22-27-9.png

    This new option presumes the sprite filenames are properly formatted and represent valid Unicode code points.

    Note that sprite filenames that contain 2 Unicode code points such as "1f596-1f3fb.png" which are the equivalent of ligatures will not get converted correctly. These will result in some large Unicode value that is not valid. I am not sure yet how to handle these with respect to the importer.

    This new feature will be included in the next preview release of the TMP package which should be next Friday (about a week from now).

    P.S. Sorry again about missing your initial post. Please always feel free to bump threads / posts on the forum when I fail to reply to them in a timely manner.
     
    Last edited: Aug 19, 2021
  3. tw1zterpknot

    tw1zterpknot

    Joined:
    Sep 19, 2021
    Posts:
    1
    Hello!, i run into the same problem of making a sprite sheet of thousands of emojis with 0xFFFF Unicode digits. So i found this post, so i tried to update my TMP from 3.0.6 to 3.20.1-pre.1 and it had a lot of compatibility errors with HDRP. I wonder if it has to do exclusively with me or is it a problem with TSM in general.

    EDIT1: I wonder if it has been implemented yet? im trying it out at the 3.20 version and the option doesnt appear.


    These are the errors:
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(15,40): error CS0122: 'HDShaderGUI' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(18,15): error CS0122: 'SurfaceOptionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(21,15): error CS0122: 'EmissionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(31,19): error CS0122: 'MaterialUIBlockList' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(38,33): error CS0115: 'HDRP_LitShaderGUI.OnMaterialGUI(MaterialEditor, MaterialProperty[])': no suitable method found to override
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(80,33): error CS0115: 'HDRP_LitShaderGUI.SetupMaterialKeywordsAndPassInternal(Material)': no suitable method found to override
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(23,9): error CS0122: 'MaterialUIBlockList' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(12,42): error CS0122: 'HDShaderGUI' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(14,15): error CS0122: 'SurfaceOptionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(18,71): error CS0122: 'SurfaceOptionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(19,15): error CS0122: 'SurfaceOptionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(21,59): error CS0122: 'EmissionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_LitShaderGUI.cs(21,90): error CS0122: 'EmissionUIBlock' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(24,19): error CS0122: 'MaterialUIBlockList' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(31,33): error CS0115: 'HDRP_UnlitShaderGUI.OnMaterialGUI(MaterialEditor, MaterialProperty[])': no suitable method found to override
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(54,33): error CS0115: 'HDRP_UnlitShaderGUI.SetupMaterialKeywordsAndPassInternal(Material)': no suitable method found to override
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(16,9): error CS0122: 'MaterialUIBlockList' is inaccessible due to its protection level
    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.1\Scripts\Editor\HDRP\HDRP_UnlitShaderGUI.cs(14,69): error CS0122: 'SurfaceOptionUIBlock' is inaccessible due to its protection level
     
    Last edited: Oct 7, 2021
  4. Sourabh_PTW

    Sourabh_PTW

    Joined:
    Mar 7, 2022
    Posts:
    33
    I stuck with same problem any solution for that
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    You should be using version 3.2.0-pre.3 for Unity 2020.3 or newer.

    Please note that as per the Upgrade Note in the package description in Package Manager, you should be updating your TMP Essential Resources and TMP Examples & Extras if you had those already imported in the project.

    Let me know if you still run into the same behavior using the latest preview.
     
  6. Sourabh_PTW

    Sourabh_PTW

    Joined:
    Mar 7, 2022
    Posts:
    33
    Issue is partially Fixed.

    Issue Fixed - Working with Small Unicode such as Smiley (1F604).
    Issue Persist - Not Working with Big Unicode such as Indian Flag(1F1EE U+1F1F3)

    Details - So in Text Mesh Pro Version - 3.2.0-pre.3 Sprite Importer one Check Box Use Filename as Unicode (Ref-1) is there once I go with option Unicode will come as file name. It works for small Unicode such as Smiley (1F604) and same but for bigger one such as Indian Flag (1F1EE U+1F1F3) and same Unicode it's taking only last Six Character of Name.

    Ref -1 :- Image as attached named "SpriteImporter"
    Ref - 2 :- Image as attached named "SpriteCharacterTable"


    Unity ,Text Mesh and Texture Packer Versions I am using : -

    Unity Version - 2021.7.2f1
    Text Mesh Pro Version -3.2.0-pre.3
    Texture Packer - 6.0.2
     

    Attached Files:

  7. RahmatAli_Noob

    RahmatAli_Noob

    Joined:
    Sep 13, 2022
    Posts:
    74
    Hi, I ran Into the Same Problem but the Emoji are Get from the Online are missing the Country's flag. Will you please share the link of the Emoji's you are using or the File Location the unity is suggesting to use.
    Thanks in Advance.
     
  8. RahmatAli_Noob

    RahmatAli_Noob

    Joined:
    Sep 13, 2022
    Posts:
    74
    Hi, there Hope You are Doing well. I Ran into the Problem Where I cannot Use the Emoji's with the Long Unicode in TMP. This is working perfectly fine with all the Face Emoji's but messing up the things for hand Emoji's and Character Emoji's due to their large Unicode.
    Is there any Way that I Will get to know to how to change the Unicode to Work work with the Keyboard. Moreover Is There Any Pack of Emoji's Suggested by unity to use With Contain all emoji's including the Flags and Other.
    @Stephan_B
    Help will be appreciated.
    Thanks in Advance.
     
    Last edited: Jul 19, 2023