From 4dc4c3464cf73c94905af50f624b049ce45ff864 Mon Sep 17 00:00:00 2001 From: Maxr1998 Date: Fri, 31 Jan 2020 15:41:28 +0100 Subject: [PATCH 1/2] Add Dockerfile for building within a container --- .dockerignore | 5 +++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..a1571bb83 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +add_emoji_gsub.pyc +build +waveflag + +.git/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..799a420bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:buster +RUN apt update && apt install -y \ + git \ + zopfli \ + libcairo2-dev + +# Install nototools +RUN git clone https://github.com/googlefonts/nototools.git /nototools +WORKDIR /nototools +RUN pip install -r requirements.txt +RUN pip install -e . + +ADD . /blobmoji +WORKDIR /blobmoji + +# Build blobmoji font +CMD make -j $(nproc) From 49deee8ba43fedf146b8f9ded0b4f863446c203e Mon Sep 17 00:00:00 2001 From: Maxr1998 Date: Sat, 1 Feb 2020 12:00:53 +0100 Subject: [PATCH 2/2] Tweak Dockerfile and add instructions on how to use it --- Dockerfile | 5 ++++- README.md | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 799a420bd..03d9f501b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,11 @@ WORKDIR /nototools RUN pip install -r requirements.txt RUN pip install -e . +# Create output dir +RUN mkdir /output + ADD . /blobmoji WORKDIR /blobmoji # Build blobmoji font -CMD make -j $(nproc) +CMD make -j $(nproc) && cp NotoColorEmoji.ttf /output/ diff --git a/README.md b/README.md index 03b547a4f..10c155e35 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,11 @@ especially if you are using zopflipng for compression. Intermediate products (compressed image files, for example) will be put into a build subdirectory; the font will be at the top level. +## Docker build + +Alternatively, you can also build the font within Docker through the provided Dockerfile. +Just run `docker build . -t blobmoji && docker run --rm -it -v "$PWD/output:/output" blobmoji`. The resulting font will reside in the 'output' folder in your current working directory. + ## Using NotoColorEmoji NotoColorEmoji uses the CBDT/CBLC color font format, which is supported by Android