Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emoji: Add emoji support to rmlui. #2222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

DolceTriade
Copy link
Member

@DolceTriade DolceTriade commented Sep 25, 2022

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.

Copy link
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

src/cgame/rocket/emojis/generate_emoji_map.py Outdated Show resolved Hide resolved
@DolceTriade
Copy link
Member Author

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.

@slipher
Copy link
Contributor

slipher commented Sep 25, 2022

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]?

@illwieckz
Copy link
Member

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! 🙂️

@DolceTriade
Copy link
Member Author

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
Copy link
Member Author

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.

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.

This also doesn't support combination emojis or emojis using a zwj (so
this means no emoji variations, etc). If we want this support, we'll
need to use the HarfBuzz library to shape the text.
@DolceTriade
Copy link
Member Author

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 😄

@necessarily-equal
Copy link
Contributor

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?

@DolceTriade
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants