Skip to content

emoji: Fix presentation selector handling

Josh Brobst requested to merge jbrobst/gtk:fix-emoji-pres into main

Currently, GTK adds the emoji presentation selector (code point FE0F) to all emoji sequences, which is invalid according to UTS #51:

The only valid emoji presentation sequences are those listed in emoji-variation-sequences.txt

To fix this, the emoji data can be changed to include the emoji presentation selector where necessary. Such cases can be inferred from the emojilib data when an emoji has a text form (text is not empty) which is the default presentation (type is 0).

However, this is complicated by skin tone variations, since the generic sequence (i.e., the one without the any skin tone modifier) may have a default text presentation. Examples of this include "hand with fingers splayed" and "person in suit levitating". Fortunately, since a needed emoji presentation selector is in the same position in a default-text generic sequence as a skin tone would be for all currently defined emojis, the existing "0 as skin tone placeholder" scheme can be slightly adapted to indicate such cases rather than adding to the data variant.

Merge request reports