Unvanquished icon indicating copy to clipboard operation
Unvanquished copied to clipboard

emoji: Add emoji support to rmlui.

Open DolceTriade opened this issue 3 years ago • 6 comments

You can use [:)] or [salute] or other known emoji short codes to use emojis in Unvanquished. These are a critical feature to help player express themselves.

This change generates an emoji map using Google's emoji data to map short names and emoticons to emojis and also provides a script to regenerate this should a new emoji spec come out.

DolceTriade avatar Sep 25 '22 09:09 DolceTriade

The emoji font is 10 MB, is it worth it?

I cannot understate how important this feature is. Also, given that it will be compressed and relatively small in terms of game asset size, I think it's worth while.

DolceTriade avatar Sep 25 '22 10:09 DolceTriade

What's the compressed size?

I suspect there will be limited usage without an emoji picker or something, because it's not discoverable. How are people supposed to know the strings like [loudly-crying]?

slipher avatar Sep 25 '22 18:09 slipher

Let's welcome [hand-with-index-finger-and-thumb-crossed], [roasted-sweet-potato] and [right-pointing-triangle-with-double-vertical-bar]. 😅️ And I wonder how people would type [♪┏(・o・)┛♪]. 🤣️

Anyway, that's good! And country flags will be appreciated! 🙂️

illwieckz avatar Sep 25 '22 19:09 illwieckz

Hm, actually, country flags don't work. Looking closer, I don't think any multi codepoint emojis work... let me see if I can fix that, or whether this is a Freetype limitation.

DolceTriade avatar Sep 26 '22 04:09 DolceTriade

So this is a freetype limitation. We need to use HarfBuzz to layout text properly (ie, parse the emojis comprising of multiple code points and variations that use a zwj. In my script, I can filter out all emojis that comprise of multiple code points and see what the result is. Let me see if I can copy paste these emojis into the game... I doubt it.

DolceTriade avatar Sep 26 '22 05:09 DolceTriade

Also, a size comparison:

❯ ls -lh /tmp/unv_*
-rw-r--r-- 1 modi users 25M Sep 25 22:40 /tmp/unv_emoji.dpk
-rw-r--r-- 1 modi users 16M Sep 25 22:43 /tmp/unv_noemoji.dpk

Turns out the emoji font does not compress well :smile:

DolceTriade avatar Sep 26 '22 05:09 DolceTriade

I think we we want to ship that without making it insufferable with regard to downloading time, we should move the fonts to another repo, and not unv_src.dpkdir. On the flip side that repo is supposed to be the only one required to load the main menu. Maybe the fonts should be bundled with daemon instead?

necessarily-equal avatar Oct 22 '22 05:10 necessarily-equal

One thing I think I should do is that since we don't support multicode emojis, if I can find a way to strip them out of the font, that should reduce the size considerably.

DolceTriade avatar Oct 22 '22 06:10 DolceTriade