Merge pull request #297 from kabisa/feature/dependency-management

Feature/dependency management
pull/303/head
rsheeter 2020-05-26 09:55:37 -07:00 committed by GitHub
commit 2d11453d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 12 deletions

View File

@ -134,7 +134,7 @@ compressed: $(ALL_COMPRESSED_FILES)
check_compress_tool: check_compress_tool:
ifdef MISSING_ZOPFLI ifdef MISSING_ZOPFLI
ifdef MISSING_OPTIPNG ifdef MISSING_OPTIPNG
$(error "neither $(ZOPFLIPNG) nor $(OPTIPNG) is available") $(error "neither $(ZOPFLIPNG) nor $(OPTIPNG) is available. For installation instructions, see README.md")
else else
@echo "using $(OPTIPNG)" @echo "using $(OPTIPNG)"
endif endif
@ -197,6 +197,11 @@ else
@$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1 @$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1
endif 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 # 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.: # prerequisite is updated and make has been invoked with -j, e.g.:
@ -214,7 +219,7 @@ endif
@rm -f "$@" @rm -f "$@"
ttx "$<" 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 $(ALL_COMPRESSED_FILES) | check_vs_adder
@$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u" @$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u"
@$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua" @$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua"

View File

@ -2,16 +2,29 @@
# Noto Emoji # Noto Emoji
Color and Black-and-White Noto emoji fonts, and tools for working with them. Color and Black-and-White Noto emoji fonts, and tools for working with them.
## Prerequisites
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 ## Building NotoColorEmoji
This project uses a virtual environment to manage dependencies. Use the following steps to get up and running.
Building NotoColorEmoji currently requires a Python 2.x wide build. To build Create a virtual environment called `noto-emoji-env`:
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.
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 especially if you are using zopflipng for compression. Intermediate products
(compressed image files, for example) will be put into a build subdirectory; the (compressed image files, for example) will be put into a build subdirectory; the
font will be at the top level. font will be at the top level.

View File

@ -18,13 +18,11 @@
__author__ = "roozbeh@google.com (Roozbeh Pournader)" __author__ = "roozbeh@google.com (Roozbeh Pournader)"
import sys import sys
from fontTools import agl from fontTools import agl
from fontTools import ttLib
from fontTools.ttLib.tables import otTables from fontTools.ttLib.tables import otTables
from fontTools import ttLib
from nototools import font_data from nototools import font_data

2
requirements.txt 100644
View File

@ -0,0 +1,2 @@
fonttools>=4.7.0
-e git://github.com/googlefonts/nototools.git#egg=master