Open drrlvn opened 5 years ago
If you customize emojify-emoji-set
, you can select twemoji-v2
or twemoji-v2-22
.
@drrlvn emojify
can now use twemoji
, I am planning to make it the default emoji set soon. Thanks @feklee
How can you use it with the latest twemoji release? As far as I can tell the releases are only source code, and the gh-pages branch just has versioned directories containing the icons. The only way I could find to download a single release was to do a sparse checkout of the gh-pages branch:
> git clone --filter=blob:none --no-checkout --branch gh-pages https://github.com/twitter/twemoji.git
Cloning into 'twemoji'...
remote: Enumerating objects: 1198, done.
Receiving objects: 98% (1163/1198), 1.57 MiB | 497.00 KiB/sd 1198
Receiving objects: 100% (1198/1198), 1.71 MiB | 508.00 KiB/s, done.
Resolving deltas: 100% (599/599), done.
> cd twemoji
> git sparse-checkout init --cone
> git sparse-checkout set v/13.0.1
> git checkout
remote: Enumerating objects: 403, done.
remote: Counting objects: 100% (403/403), done.
remote: Compressing objects: 100% (294/294), done.
remote: Total 6704 (delta 162), reused 109 (delta 109), pack-reused 6301
Receiving objects: 100% (6704/6704), 4.78 MiB | 1.26 MiB/s, done.
Resolving deltas: 100% (1302/1302), done.
Updating files: 100% (6739/6739), done.
Your branch is up to date with 'origin/gh-pages'.
@SamHasler unfortunately the twemoji cannot be used directly in the project, I need to convert them into a format that can be used by this package, will try and do that next time I work on this. Thanks!
Convert the SVG to 24px PNG? Do you have a process for that?
That and also renaming files to the names, emojify expects. I do not have a documented process for it, maybe now is the time to document it.
Assuming you have ImageMagick installed, once you have run the above commands to checkout one of the version directories of the twemoji repo and are in it's root directory you can run this to generate the icons:
mkdir 13.0.1/22x22
find 13.0.1/svg -name "*.svg" -execdir sh -c 'magick convert "$1" -background none -density 300 -resize ${2}x${2} -define icon:auto-resize -alpha remove -colors 256 "../${2}x${2}/${1%.svg}.png"' _ {} 22 \;
It takes a long time to run so you might want to run it on a subset first to check it works.
e.g. find 13.0.1/svg -name "1f9??.svg" ...
It's based on the answer here. There are also answers using inkscape if you prefer that to ImageMagick (see the answer below the one I linked to for the inkscape width and height parameters which I couldn't find documented anywhere else).
It shouldn't be hard to make a script that takes a version number and then goes and does all the work.
I just realised emacs has SVG support. Could we not just use the twemoji SVGs directly?
once you have cloned the repo you can use this to get a list of versions:
$ git ls-files | cut -d"/" -f1 | uniq
12.0.4
12.1.0-alpha.3
12.1.0-alpha.4
12.1.0
12.1.1
12.1.2-alpha.1
12.1.2-alpha.2
12.1.2
12.1.3
12.1.4
12.1.5
12.1.6
13.0.0
13.0.1
README.md
latest
so it should be possible to write a script to checkout the latest version without having to supply a version number.
Hey @SamHasler thanks for the research, I am hoping to dedicate sometime this weekend to automate this process, will post any updates here
Since emojione changed their license last year everyone (include emojify) are stuck with version 2.2.6. However, twitter have an alternative under CC-BY 4.0 license that continues to be updated called twemoji.
Maybe emojify should switch to using that?