How to get sprites to automatically fill in for certain Unicode characters?

I use some unusual characters in my app, like die faces, card suits, etc… and yes, I know I could probably find a font that has these, but I have reason to be happier representing them as sprites.

So I prepared my sprite asset, and even managed (by hacking the asset file with a text editor) to get the correct Unicode values assigned to each one:

I set this as the default sprite atlas in the TMPro Settings. Then I tried using it in a TextMeshProUGUI, in three ways: a normal sprite reference, the character just pasted right in, and the character as a \U escape sequence:
8160122--1060853--upload_2022-5-26_15-37-47.png

And the result…
8160122--1060856--upload_2022-5-26_15-38-4.png

Sadness. The tag works, but either way of just dealing with the Unicode does not.

I’ve seen comments from @Stephan_B suggesting that sprites can be automatically substituted for Unicode characters in the text. But I can’t find anything on how to set that up. What am I missing?

1 Like

Nobody has any idea? Is it really impossible to have sprites automatically displayed for certain Unicode characters?

Any Update? Thanks in advance!

As it happens, I just did this today in another project, and it worked. I didn’t even have to hack the Sprite Asset file; the Sprite Character Table entries were editable in the inspector. I filled in the right hex code for each Unicode character, and now when I include those characters in a TextMeshProUGUI, they appear as it should.

I can only assume that something was buggy when I tried this back in 2022, which has since been fixed.

Thanks! Maybe it’s a TMP problem. This thread helped me:Full Emoji Support Api (emoji Sequen - Unity Engine - Unity Discussions