jgm / emojis

Haskell library for emojis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not support certain emoji modifiers

Xitian9 opened this issue · comments

Emoji can have various modifiers, for example the skin tone modifier. The gemoji library for example includes the ninja emoji, with a note that in can take skin tone modifiers. There are more complicated examples: the kiss: man, man emoji can take two different skin tone modifiers, one for each participant in the kiss.

This information seems to be lost when importing here, and skin tone modifiers are not included in the listed emoji.

Is the information somewhere in emoji.json in the repository?
That is taken directly from gemoji source, but I don't see these things there.

It doesn't seem to be in the emoji.json in this repository, but it is in the emoji.json in the gemoji repository: https://github.com/github/gemoji/blob/master/db/emoji.json. See that some of them have the field "skin_tones": true.

Edit: It seems that the Makefile will throw out all fields from gemoji's emoji.json except for emoji and alias, which is why it's not showing up in this repository.

It's a bit unclear how to get a list of all emoji from gemoji's library, as a simple boolean flag stating that it ‘accepts skin tones’ doesn't actually tell you in what position it accepts skin tones or how many. As far as I know, only the unicode spec is definitive.

https://unicode.org/Public/emoji/14.0/emoji-sequences.txt
https://unicode.org/Public/emoji/14.0/emoji-zwj-sequences.txt

The main use I make of this library is to support pandoc's handling of GitHub emoji aliases, so if there aren't aliases for the skin tone variants, it may be out of scope.

The reason I'm interested is that we're looking for a library code to properly calculate the widths of text in monospace font, including wide characters, combining characters, and emoji. If it's out of scope for this library, perhaps that functionality can be broken out into a separate library.

I'm open to extending the functionality of this library. That seems better than yet another emoji library.

Perhaps we could generate data from the unicode emoji tables, and use gemoji's emoji.json just for the GitHub aliases.

That sounds like a good idea.