From 8bc1751449b650d2f9b122df5d747f6d5ad0f4d1 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Fri, 10 Apr 2020 16:16:03 +0200 Subject: [PATCH 01/20] add requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..4e59d7d60 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fonttools==4.7.0 +-e git://github.com/googlefonts/nototools.git#egg=master \ No newline at end of file From cbe5031b4bb311fbf77567d2ae027599176d6041 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Fri, 10 Apr 2020 16:21:37 +0200 Subject: [PATCH 02/20] install instructions --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1883dd933..62638bff9 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,19 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. ## Building NotoColorEmoji -Building NotoColorEmoji currently requires a Python 2.x wide build. To build -the emoji font you will require a few files from nototools. Clone a copy from -https://github.com/googlei18n/nototools and either put it in your PYTHONPATH or -use 'python setup.py develop' ('install' currently won't fully install all the -data used by nototools). You will also need fontTools, get it from -https://github.com/behdad/fonttools.git. +Create a virtual environment called: -Then run make. NotoColorEmoji is the default target. It's suggested to use -j, + python3 -m venv noto-emoji-env + +Activate the virtual environment: + + source noto-emoji-env/bin/activate + +Install the python requirements with: + + pip install -r requirements.txt + +Then run `make`. NotoColorEmoji is the default target. It's suggested to use -j, 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. From 73f559c94be70d367c68645428bcab5ee6efe100 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 09:28:11 +0200 Subject: [PATCH 03/20] import exceptions --- add_emoji_gsub.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/add_emoji_gsub.py b/add_emoji_gsub.py index 9f578a302..61fe386ef 100755 --- a/add_emoji_gsub.py +++ b/add_emoji_gsub.py @@ -18,14 +18,22 @@ __author__ = "roozbeh@google.com (Roozbeh Pournader)" - import sys -from fontTools import agl -from fontTools import ttLib -from fontTools.ttLib.tables import otTables +try: + from fontTools import agl +except ImportError as er: + sys.exit("""Failed to import fontTools. + Please make sure 'pip install -r requirements.txt' runs succesfull""") -from nototools import font_data +from fontTools.ttLib.tables import otTables +from fontTools import ttLib + +try: + from nototools import font_data +except ImportError as er: + sys.exit("""Failed to import nototools. + Please make sure 'pip install -r requirements.txt' runs succesfull""") def create_script_list(script_tag='DFLT'): From f78f903d111ec7ef99982cfeb00e50cc182af058 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 09:30:37 +0200 Subject: [PATCH 04/20] fonttools greater of equal --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4e59d7d60..9748ccfa8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -fonttools==4.7.0 +fonttools>=4.7.0 -e git://github.com/googlefonts/nototools.git#egg=master \ No newline at end of file From 742b5a1c27a1e2f00bca566dcb669829911c076c Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 09:32:47 +0200 Subject: [PATCH 05/20] readme description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 62638bff9..999faa404 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. ## Building NotoColorEmoji +Building NotoColorEmoji requires Python 3, and uses virtual envorinments to manage dependencies. Use the following steps to get up and running. Create a virtual environment called: From 7d56acd759297ce1d68f7943bdb795f671c121f0 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 09:33:46 +0200 Subject: [PATCH 06/20] explain steps --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 999faa404..d7a226f4c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. ## Building NotoColorEmoji Building NotoColorEmoji requires Python 3, and uses virtual envorinments to manage dependencies. Use the following steps to get up and running. -Create a virtual environment called: +Create a virtual environment called `noto-emoji-env`: python3 -m venv noto-emoji-env From 4596ae8a0d9e77ee923390335af0f8ff476f716f Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 13:50:49 +0200 Subject: [PATCH 07/20] correct spelling --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7a226f4c..9376d1745 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. ## Building NotoColorEmoji -Building NotoColorEmoji requires Python 3, and uses virtual envorinments to manage dependencies. Use the following steps to get up and running. +Building NotoColorEmoji requires Python 3, and uses virtual environments to manage dependencies. Use the following steps to get up and running. Create a virtual environment called `noto-emoji-env`: @@ -13,7 +13,7 @@ Activate the virtual environment: source noto-emoji-env/bin/activate -Install the python requirements with: +Install the Python requirements with: pip install -r requirements.txt From ac9a6397f78a8e2685d00977b40ab46121d9ed80 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 16:56:16 +0200 Subject: [PATCH 08/20] readme prerequisites --- Makefile | 2 +- README.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 148ca66fa..20b75cfed 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ compressed: $(ALL_COMPRESSED_FILES) check_compress_tool: ifdef MISSING_ZOPFLI ifdef MISSING_OPTIPNG - $(error "neither $(ZOPFLIPNG) nor $(OPTIPNG) is available") + $(error "neither $(ZOPFLIPNG) nor $(OPTIPNG) is available. For installation instructions, see README.md") else @echo "using $(OPTIPNG)" endif diff --git a/README.md b/README.md index 9376d1745..f7a93961a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,14 @@ # Noto Emoji Color and Black-and-White Noto emoji fonts, and tools for working with them. +## Prerequisites +- This project uses Python 3. +- You need either [zopflipng](https://github.com/google/zopfli) or [optipng](ttp://optipng.sourceforge.net/). (Zopflipng is better (about 5-10%) but much slower.) +- You need [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) + + ## Building NotoColorEmoji -Building NotoColorEmoji requires Python 3, and uses virtual environments to manage dependencies. Use the following steps to get up and running. +This project uses a virtual environment to manage dependencies. Use the following steps to get up and running. Create a virtual environment called `noto-emoji-env`: From e31a5dbc6b08344d2cf01301b1d96ac962d82838 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 17:04:03 +0200 Subject: [PATCH 09/20] add pngquant to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7a93961a..cb7fbff07 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. - This project uses Python 3. - You need either [zopflipng](https://github.com/google/zopfli) or [optipng](ttp://optipng.sourceforge.net/). (Zopflipng is better (about 5-10%) but much slower.) - You need [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) - +- You need [pngquant](https://pngquant.org/) ## Building NotoColorEmoji This project uses a virtual environment to manage dependencies. Use the following steps to get up and running. From d4ebb27c6ddf54077f50da1e847431f70f2cf04e Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Tue, 14 Apr 2020 17:34:35 +0200 Subject: [PATCH 10/20] readme prerequisites steps --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb7fbff07..6943d49b8 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,11 @@ Color and Black-and-White Noto emoji fonts, and tools for working with them. ## Prerequisites -- This project uses Python 3. -- You need either [zopflipng](https://github.com/google/zopfli) or [optipng](ttp://optipng.sourceforge.net/). (Zopflipng is better (about 5-10%) but much slower.) -- You need [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) -- You need [pngquant](https://pngquant.org/) +Building Noto Color Emoji requires: +- Python 3 +- [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) +- [pngquant](https://pngquant.org/) +- Either [zopflipng](https://github.com/google/zopfli) or [optipng](http://optipng.sourceforge.net/). Zopflipng is better (about 5-10%) but much slower. ## Building NotoColorEmoji This project uses a virtual environment to manage dependencies. Use the following steps to get up and running. From 495a77d7278089548c8948472b8e31a14b92f3df Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Wed, 6 May 2020 15:36:07 +0200 Subject: [PATCH 11/20] remove import try --- add_emoji_gsub.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/add_emoji_gsub.py b/add_emoji_gsub.py index 61fe386ef..9f1c40366 100755 --- a/add_emoji_gsub.py +++ b/add_emoji_gsub.py @@ -20,20 +20,10 @@ __author__ = "roozbeh@google.com (Roozbeh Pournader)" import sys -try: - from fontTools import agl -except ImportError as er: - sys.exit("""Failed to import fontTools. - Please make sure 'pip install -r requirements.txt' runs succesfull""") - +from fontTools import agl from fontTools.ttLib.tables import otTables from fontTools import ttLib - -try: - from nototools import font_data -except ImportError as er: - sys.exit("""Failed to import nototools. - Please make sure 'pip install -r requirements.txt' runs succesfull""") +from nototools import font_data def create_script_list(script_tag='DFLT'): From db01fa994ace5b0bb5e9b8530a1c3aa41d147d1d Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Thu, 7 May 2020 13:25:10 +0200 Subject: [PATCH 12/20] add exception when not in virtual env --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 20b75cfed..326f8f581 100644 --- a/Makefile +++ b/Makefile @@ -197,6 +197,11 @@ else @$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1 endif +check-virtual-env: +ifeq (${VIRTUAL_ENV},) + @echo Please start your virtual environment, and run: "'pip install -r requirements.txt'". + @false +endif # Make 3.81 can endless loop here if the target is missing but no # prerequisite is updated and make has been invoked with -j, e.g.: @@ -214,7 +219,7 @@ endif @rm -f "$@" ttx "$<" -$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \ +$(EMOJI).ttf: check-virtual-env $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \ $(ALL_COMPRESSED_FILES) | check_vs_adder @$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u" @$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua" From 36c35e0fc67719e2c25d0696d3aede84e29e69c4 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Tue, 26 May 2020 10:20:08 -0700 Subject: [PATCH 13/20] Update README.md Fixes #300 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6943d49b8..d6bfa5a0c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ font will be at the top level. NotoColorEmoji uses the CBDT/CBLC color font format, which is supported by Android and Chrome/Chromium OS. Windows supports it starting with Windows 10 Anniversary -Update in Chome and Edge. On macOS, only Chrome supports it, while on Linux it will +Update in Chrome and Edge. On macOS, only Chrome supports it, while on Linux it will support it with some fontconfig tweaking, see [issue #36](https://github.com/googlei18n/noto-emoji/issues/36). Currently we do not build other color font formats. ## Color emoji assets From 48c935347a752a5a729c0269b0d65ade1789d7ef Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sat, 30 May 2020 14:11:54 -0700 Subject: [PATCH 14/20] only zopflipng --- Makefile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 326f8f581..c0ebd9f51 100644 --- a/Makefile +++ b/Makefile @@ -108,12 +108,6 @@ ifeq (,$(shell which $(ZOPFLIPNG))) endif endif -ifeq (,$(shell which $(OPTIPNG))) - ifeq (,$(wildcard $(OPTIPNG))) - MISSING_OPTIPNG = fail - endif -endif - ifeq (, $(shell which $(VS_ADDER))) MISSING_ADDER = fail endif @@ -133,11 +127,7 @@ compressed: $(ALL_COMPRESSED_FILES) check_compress_tool: ifdef MISSING_ZOPFLI - ifdef MISSING_OPTIPNG - $(error "neither $(ZOPFLIPNG) nor $(OPTIPNG) is available. For installation instructions, see README.md") - else - @echo "using $(OPTIPNG)" - endif + $(error "Missing $(ZOPFLIPNG). Try 'brew install zopfli' (Mac) or 'sudo apt-get zopfli' (linux)") else @echo "using $(ZOPFLIPNG)" endif From b81bb6c65eabd386fd729d701c861c641f826666 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sat, 30 May 2020 14:19:33 -0700 Subject: [PATCH 15/20] get nototools from pypi --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9748ccfa8..4cda58f53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ fonttools>=4.7.0 --e git://github.com/googlefonts/nototools.git#egg=master \ No newline at end of file +notofonttools>=0.2.4 \ No newline at end of file From 0aaa0fccce2992893ae3b264905ace178b4d0717 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sat, 30 May 2020 14:19:49 -0700 Subject: [PATCH 16/20] update ignore and readme --- .gitignore | 1 + README.md | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index a5cc017b1..8307d40fe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__/ *.pyc waveflag build/ +venv/ diff --git a/README.md b/README.md index d6bfa5a0c..01401661d 100644 --- a/README.md +++ b/README.md @@ -7,27 +7,25 @@ Building Noto Color Emoji requires: - Python 3 - [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) - [pngquant](https://pngquant.org/) -- Either [zopflipng](https://github.com/google/zopfli) or [optipng](http://optipng.sourceforge.net/). Zopflipng is better (about 5-10%) but much slower. +- [zopflipng](https://github.com/google/zopfli) ## Building NotoColorEmoji -This project uses a virtual environment to manage dependencies. Use the following steps to get up and running. +This project uses a virtual environment to manage dependencies. Use the following steps to get up and running: -Create a virtual environment called `noto-emoji-env`: +```shell +# make sure you have the Prerequisites - python3 -m venv noto-emoji-env +# create & activate a virtual environment +python3 -m venv venv +source venv/bin/activate -Activate the virtual environment: +# install python requirements +pip install -r requirements.txt - source noto-emoji-env/bin/activate +time make -j +``` -Install the Python requirements with: - - pip install -r requirements.txt - -Then run `make`. NotoColorEmoji is the default target. It's suggested to use -j, -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. +Intermediate products (compressed image files, for example) will be put into a build subdirectory; the font will be at the top level. ## Using NotoColorEmoji From 0553e8fb9b2e046a2af5b404afc5f2b6a3ec7963 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sat, 30 May 2020 14:22:47 -0700 Subject: [PATCH 17/20] no reason to display using zopflipng if it is the only choice --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index c0ebd9f51..127c0ce00 100644 --- a/Makefile +++ b/Makefile @@ -128,8 +128,6 @@ compressed: $(ALL_COMPRESSED_FILES) check_compress_tool: ifdef MISSING_ZOPFLI $(error "Missing $(ZOPFLIPNG). Try 'brew install zopfli' (Mac) or 'sudo apt-get zopfli' (linux)") -else - @echo "using $(ZOPFLIPNG)" endif check_vs_adder: From d1137576043d419d945379dd9344d9c19469848e Mon Sep 17 00:00:00 2001 From: Rod S Date: Sat, 30 May 2020 14:51:53 -0700 Subject: [PATCH 18/20] correct apt-get sample --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 127c0ce00..43331e1ee 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ compressed: $(ALL_COMPRESSED_FILES) check_compress_tool: ifdef MISSING_ZOPFLI - $(error "Missing $(ZOPFLIPNG). Try 'brew install zopfli' (Mac) or 'sudo apt-get zopfli' (linux)") + $(error "Missing $(ZOPFLIPNG). Try 'brew install zopfli' (Mac) or 'sudo apt-get install zopfli' (linux)") endif check_vs_adder: From 97f95d0d696806dd7fbe201d0c7432ec1aafe4ca Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sun, 31 May 2020 12:05:29 -0700 Subject: [PATCH 19/20] tweak check for tools & venv --- Makefile | 67 ++++++++++++++++++++++------------------------ flag_glyph_name.py | 6 ++++- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 43331e1ee..dd457d27d 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,8 @@ PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force BODY_DIMENSIONS = 136x128 IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center -# zopflipng is better (about 5-10%) but much slower. it will be used if -# present. pass ZOPFLIPNG= as an arg to make to use optipng instead. - ZOPFLIPNG = zopflipng -OPTIPNG = optipng +TTX = ttx EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py # flag for emoji builder. Default to legacy small metrics for the time being. @@ -81,6 +78,23 @@ SELECTED_FLAGS = AC AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ \ ZA ZM ZW \ GB-ENG GB-SCT GB-WLS +ifeq (,$(shell which $(ZOPFLIPNG))) + ifeq (,$(wildcard $(ZOPFLIPNG))) + MISSING_ZOPFLI = fail + endif +endif + +ifndef VIRTUAL_ENV + MISSING_VENV = fail +endif + +ifeq (, $(shell which $(VS_ADDER))) + MISSING_PY_TOOLS = fail +endif +ifeq (, $(shell which $(TTX))) + MISSING_PY_TOOLS = fail +endif + ALL_FLAGS = $(basename $(notdir $(wildcard $(FLAGS_SRC_DIR)/*.png))) FLAGS = $(SELECTED_FLAGS) @@ -89,7 +103,11 @@ FLAG_NAMES = $(FLAGS:%=%.png) FLAG_FILES = $(addprefix $(FLAGS_DIR)/, $(FLAG_NAMES)) RESIZED_FLAG_FILES = $(addprefix $(RESIZED_FLAGS_DIR)/, $(FLAG_NAMES)) +ifndef MISSING_PY_TOOLS FLAG_GLYPH_NAMES = $(shell $(PYTHON) flag_glyph_name.py $(FLAGS)) +else +FLAG_GLYPH_NAMES = +endif RENAMED_FLAG_NAMES = $(FLAG_GLYPH_NAMES:%=emoji_%.png) RENAMED_FLAG_FILES = $(addprefix $(RENAMED_FLAGS_DIR)/, $(RENAMED_FLAG_NAMES)) @@ -101,17 +119,6 @@ ALL_NAMES = $(EMOJI_NAMES) $(RENAMED_FLAG_NAMES) ALL_QUANTIZED_FILES = $(addprefix $(QUANTIZED_DIR)/, $(ALL_NAMES)) ALL_COMPRESSED_FILES = $(addprefix $(COMPRESSED_DIR)/, $(ALL_NAMES)) -# tool checks -ifeq (,$(shell which $(ZOPFLIPNG))) - ifeq (,$(wildcard $(ZOPFLIPNG))) - MISSING_ZOPFLI = fail - endif -endif - -ifeq (, $(shell which $(VS_ADDER))) - MISSING_ADDER = fail -endif - emoji: $(EMOJI_FILES) @@ -125,16 +132,16 @@ quantized: $(ALL_QUANTIZED_FILES) compressed: $(ALL_COMPRESSED_FILES) -check_compress_tool: +check_tools: ifdef MISSING_ZOPFLI $(error "Missing $(ZOPFLIPNG). Try 'brew install zopfli' (Mac) or 'sudo apt-get install zopfli' (linux)") endif - -check_vs_adder: -ifdef MISSING_ADDER - $(error "$(VS_ADDER) not in path, run setup.py in nototools") +ifdef MISSING_VENV + $(error "Please start your virtual environment, and run: "'pip install -r requirements.txt'") +endif +ifdef MISSING_PY_TOOLS + $(error "Missing tools; run: "'pip install -r requirements.txt' in your virtual environment") endif - $(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR): mkdir -p "$@" @@ -178,18 +185,8 @@ $(QUANTIZED_DIR)/%.png: $(RENAMED_FLAGS_DIR)/%.png | $(QUANTIZED_DIR) $(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png | $(QUANTIZED_DIR) @($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<";cp $< $@;; *) exit "$$?";; esac) -$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_compress_tool $(COMPRESSED_DIR) -ifdef MISSING_ZOPFLI - @$(OPTIPNG) -quiet -o7 -clobber -force -out "$@" "$<" -else +$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_tools $(COMPRESSED_DIR) @$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1 -endif - -check-virtual-env: -ifeq (${VIRTUAL_ENV},) - @echo Please start your virtual environment, and run: "'pip install -r requirements.txt'". - @false -endif # Make 3.81 can endless loop here if the target is missing but no # prerequisite is updated and make has been invoked with -j, e.g.: @@ -207,8 +204,8 @@ endif @rm -f "$@" ttx "$<" -$(EMOJI).ttf: check-virtual-env $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \ - $(ALL_COMPRESSED_FILES) | check_vs_adder +$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \ + $(ALL_COMPRESSED_FILES) | check_py_tools @$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u" @$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua" @$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua" @@ -223,5 +220,5 @@ clean: .SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \ $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES) -.PHONY: clean flags emoji renamed_flags quantized compressed check_compress_tool +.PHONY: clean flags emoji renamed_flags quantized compressed check_tools diff --git a/flag_glyph_name.py b/flag_glyph_name.py index e5ce40c20..84cfeb64b 100755 --- a/flag_glyph_name.py +++ b/flag_glyph_name.py @@ -22,7 +22,11 @@ __author__ = 'roozbeh@google.com (Roozbeh Pournader)' import re import sys -import add_emoji_gsub +try: + import add_emoji_gsub +except ImportError as e: + print(e, file=sys.stderr) + sys.exit('Python environment is not setup right') def two_letter_code_to_glyph_name(region_code): return 'u%04x_%04x' % ( From 4fddbebe7b4d481248e584610401b630b006f4f4 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Sun, 31 May 2020 12:07:55 -0700 Subject: [PATCH 20/20] missing a spot --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dd457d27d..9760d6721 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ $(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_tools $(COMPRESSED_DIR) ttx "$<" $(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \ - $(ALL_COMPRESSED_FILES) | check_py_tools + $(ALL_COMPRESSED_FILES) | check_tools @$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u" @$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua" @$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"