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

Does not support certain emoji modifiers #1

Closed
Xitian9 opened this issue Oct 6, 2021 · 8 comments · Fixed by #2
Closed

Does not support certain emoji modifiers #1

Xitian9 opened this issue Oct 6, 2021 · 8 comments · Fixed by #2

Comments

@Xitian9
Copy link
Contributor

Xitian9 commented Oct 6, 2021

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.

@jgm
Copy link
Owner

jgm commented Oct 6, 2021

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.

@Xitian9
Copy link
Contributor Author

Xitian9 commented Oct 6, 2021

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.

@Xitian9
Copy link
Contributor Author

Xitian9 commented Oct 6, 2021

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

@jgm
Copy link
Owner

jgm commented Oct 6, 2021

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.

@Xitian9
Copy link
Contributor Author

Xitian9 commented Oct 6, 2021

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.

@jgm
Copy link
Owner

jgm commented Oct 6, 2021

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

@jgm
Copy link
Owner

jgm commented Oct 6, 2021

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

@Xitian9
Copy link
Contributor Author

Xitian9 commented Oct 6, 2021

That sounds like a good idea.

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 a pull request may close this issue.

2 participants