From 8bc1751449b650d2f9b122df5d747f6d5ad0f4d1 Mon Sep 17 00:00:00 2001 From: guidotheelen Date: Fri, 10 Apr 2020 16:16:03 +0200 Subject: [PATCH 01/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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"