-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Hi! I have a pipeline that builds ttf files two twemoji. It builds Twemoji as a TrueType font. In particular, it is usable on modern Linux (either desktop or mobile) as well as other Unix-like distributions.
Mozilla has twemoji-colr, but that's in a font-format designed by Adobe and Mozilla, which basically only work on Windows, Firefox and some very rare applications. Major toolkits like Qt and GTK do not support that format.
I wrote these about two months ago and the builds are used downstream by Alpine Linux packages. I didn't see much hope in up-streaming these to Twitter's repo since, well Twitter is undergoing changes.
I'm not sure what your plans are for publishing artefacts, but perhaps this can serve as a reference for building truetype files for tags/releases.
The build script is a somehow of a hack, and leverages Noto's build system for its emoji fonts and a lot of its scripts. It's a mix of the Fedora recipe and an old ArchLinux recipe.
image: alpine/edge
packages:
- make
- graphicsmagick
- cairo-dev
- nototools
- pngquant
- zopfli
- rsync
environment:
VERSION: 14.0.2
sources:
- https://src.fedoraproject.org/rpms/twitter-twemoji-fonts.git#78a8615f22996e173b6489b004210f6302cfa456
- https://github.com/twitter/twemoji.git#v14.0.2
- https://github.com/googlefonts/noto-emoji.git#ac1703e9d7feebbf5443a986e08332b1e1c5afcf
tasks:
- patch: |
cd noto-emoji
patch -p1 -i ../twitter-twemoji-fonts/noto-emoji-use-system-pngquant.patch
patch -p1 -i ../twitter-twemoji-fonts/noto-emoji-build-all-flags.patch
patch -p1 -i ../twitter-twemoji-fonts/noto-emoji-use-gm.patch
- prepare: |
cd noto-emoji
mv NotoColorEmoji.tmpl.ttx.tmpl Twemoji.tmpl.ttx.tmpl
sed -i 's/Noto Color Emoji/Twemoji/; s/NotoColorEmoji/Twemoji/; s/Copyright .* Google Inc\./Twitter, Inc and other contributors./; s/ Version .*/ '$VERSION'/; s/.*is a trademark.*//; s/Google, Inc\./Twitter, Inc and other contributors/; s,http://www.google.com/get/noto/,https://github.com/twitter/twemoji/,; s/.*is licensed under.*/ Creative Commons Attribution 4.0 International/; s,http://scripts.sil.org/OFL,http://creativecommons.org/licenses/by/4.0/,' Twemoji.tmpl.ttx.tmpl
cd ../twemoji/assets/72x72/
for png in *.png; do
mv $png emoji_u${png//-/_}
done
- build: |
cd noto-emoji
make EMOJI=Twemoji EMOJI_SRC_DIR=../twemoji/assets/72x72 FLAGS= BODY_DIMENSIONS=76x72
- setup-ssh: |
echo "anchor.whynothugo.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE2WacYpYEP5vvevx4NXQn3Ktd53pBkZR/bpPoS3Wkyg" > $HOME/.ssh/known_hosts
- rsync: |
cd noto-emoji
install -Dm 644 Twemoji.ttf artefacts/twemoji.ttf/$(date '+%Y-%m-%d_%H-%M')/Twemoji-$VERSION.ttf
rsync -r artefacts/ rsync@anchor.whynothugo.nl:./