diff options
author | Brad Erickson <eosrei@gmail.com> | 2016-02-13 05:17:08 +0300 |
---|---|---|
committer | Brad Erickson <eosrei@gmail.com> | 2016-02-16 11:45:32 +0300 |
commit | 34dc3a8570930a7bffbdaadc18c996ba3d06d177 (patch) | |
tree | 7f616d6ba0885395a1ff1087990d0aab2cf7f2d2 /Makefile | |
parent | 25791621a643b156b4f333fdecab736c3b289c83 (diff) |
make: Create Makefile to generate SVG traces
The OpenType font spec requires standard glyphs for each code point.
The SVGinOT versions are optional. This Makefile generates single color
SVG files from the original EmojiOne SVG set. The process is involved,
but has reasonable, though not perfect, results.
1. Make the EmojiOne SVG into a PNG with Inkscape
2. Make the PNG into a BMP with ImageMagick
3. Make the BMP into a Edge Detected PGM with mkbitmap
4. Make the PGM into a black SVG trace with potrace
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d40f77f --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ + +SVG_SOURCE := assets/emojione/assets/svg +SVG_FILES := $(wildcard $(SVG_SOURCE)/*.svg) +SVG_TRACE_FILES := $(patsubst $(SVG_SOURCE)/%.svg, build/4-svg-trace/%.svg, $(SVG_FILES)) + +.PHONY: build + + +all: EmojiOne-SVGinOT.ttf + +EmojiOne-SVGinOT.ttf: build $(SVG_TRACE_FILES) + echo "done!" + + +# Create black SVG traces of the color SVGs to use as glyphs. +# 1. Make the EmojiOne SVG into a PNG with Inkscape +# 2. Make the PNG into a BMP with ImageMagick +# 3. Make the BMP into a Edge Detected PGM with mkbitmap +# 4. Make the PGM into a black SVG trace with potrace +build/4-svg-trace/%.svg: $(SVG_SOURCE)/%.svg + inkscape -w 1000 -h 1000 -z -e build/1-svg-png/$(*F).png $< + convert build/1-svg-png/$(*F).png build/2-svg-bmp/$(*F).bmp + rm build/1-svg-png/$(*F).png + mkbitmap -g -s1 -f 10 -o build/3-svg-pgm/$(*F).pgm build/2-svg-bmp/$(*F).bmp + rm build/2-svg-bmp/$(*F).bmp + potrace -s --height 1000pt --width 1000pt -o $@ build/3-svg-pgm/$(*F).pgm + rm build/3-svg-pgm/$(*F).pgm + +# Create the build directories +build: + mkdir -p build + mkdir -p build/1-svg-png + mkdir -p build/2-svg-bmp + mkdir -p build/3-svg-pgm + mkdir -p build/4-svg-trace |