Adding OpenMoji as a new emoji set

Continuing the discussion from Adding a whole new Emoji set?:

Could we add this as a whole new set?

15 Likes

@joffreyjaffeux you’re the emoji-guy, right? :metal:

Could you provide a 30s rundown on how a contributor can add a new emoji set?

1 Like

Not really sorry, the current process is parsing unicode website and not designed to add anything manually. Open Emoji is not used on the unicode emoji list, it’s possible it would still be easy to add it but I would have to look at it more to answer this, and at this point I should probably do it myself.

I have tons of fixes to do to emojis I should dedicate a week for this.

8 Likes

I would also really like to see this. It would be nice for Fedora to use an all-open source emoji set.

I’m not sure what you mean by the unicode emoji list — since it’s a standard, all of the code-points are the same. And you’ve got a mapping of the names discourse uses to those. So, as a first pass… something like this?

#!/bin/bash
TARGETDIR="./discourse/public/images/emoji/openmoji"

[[ ! -f openmoji-72x72-color.zip ]] && curl -L -O https://github.com/hfg-gmuend/openmoji/releases/latest/download/openmoji-72x72-color.zip
unzip -u -d openmoji-color openmoji-72x72-color.zip

mkdir -p $TARGETDIR

curl -s https://raw.githubusercontent.com/discourse/discourse/main/lib/emoji/db.json | 
    jq -r '.emojis[] | "\(.code) \(.name)"' |
    while read -r codepoint name; do 
        cp openmoji-color/${codepoint^^}.png ${TARGETDIR}/${name}.png 2>/dev/null || echo "Missing ${name}"
    done
1 Like

We source our emoji from Full Emoji List, v15.1.

If you want to work on adding a new emoji set, the tool we use to update lives at emoji-db/Rakefile at master · jjaffeux/emoji-db · GitHub

5 Likes

Oh, I get it. I guess that makes sense, because the vendors probably do not provide the files in a helpful way themselves. So, parsing HTML it is!

But for OpenMoji, you just need the code point, and then you can get the corresponding 72×72 png from openmoji/color/72x72 at master · hfg-gmuend/openmoji · GitHub (or SVG if you like).

So, after you find the code point in the HTML, grab the corresponding file that way, instead of extracting it from another column.

For example: :star_struck: = 1F929 → https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/color/72x72/1F929.png

Although, actually — Today I Learned that the Twitter emoji set is also open source. That’s awesome, Twitter! GitHub - twitter/twemoji: Emoji for everyone. https://twemoji.twitter.com/, and you can get those in the same way — e.g, https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f929.png (although annoyingly the two sources are inconsistent with upper vs lower case).

3 Likes

We already ship the Twitter set in Discourse.

2 Likes

Yeah, I’m just noting that there is a way to get it other than scraping the HTML page which says “do not rely on the format of this page”. :slight_smile:

1 Like

Does that other way get us all the different emoji sets we support :stuck_out_tongue: ?

That page is pretty nifty, gives us lots of stuff in a single swoop.

2 Likes

I definitely see the appeal, but of course it also has limitations. Fundamentally, it seems fragile to key off of the page layout (which is incredibly specific and not really meant for that) rather than the code points, which are a universal standard.

1 Like

Maybe there is some update here?

Could be great to cut corporations on universal things like emojis. We always used them and they need to stay free =)