Skip to content

Support composite emoji

Alice Mikhaylenko requested to merge wip/exalm/emoji into main

These characters are really ligatures, and consist of multiple other characters. This means we can't pass around single gunichars anymore, and have to work with strings. Thankfully, gjs is flexible enough that it's completely transparent on JS side.

Rework emoji.h. Since we can't assume one gunichar == one emoji anymore, we have to split the sequences and indices. We also need to store emoji names and it would be nice to follow the proper emoji order as listed in emoji-test.txt as well.

Since UCD and Emoji names can apparently differ (for example, U+1F646 is "FACE WITH OK GESTURE" in UCD and "person gesturing OK" in Emoji data), we need to use Emoji names for existing emoji as well.

At this point we also need to stop handling emoji in the regular code path. For that, make a synthetic "singular" group listing all the non-composite emoji sorted by indices, so we can bsearch this group.

Special case related characters for composite emoji, just return their components in this case.

Fixes #69 (closed)

Not marking #13 as fixed as this just lists all variants as is instead of offering a dropdown or anything.

Screenshot_from_2022-03-10_22-35-14

Screenshot_from_2022-03-10_22-35-17

Screenshot_from_2022-03-10_22-35-22

Screenshot_from_2022-03-10_22-35-27

Screenshot_from_2022-03-10_22-35-33

Screenshot_from_2022-03-10_22-35-35

Merge request reports