diff options
author | Brad Erickson <eosrei@gmail.com> | 2016-03-11 05:57:50 +0300 |
---|---|---|
committer | Brad Erickson <eosrei@gmail.com> | 2016-03-11 05:57:50 +0300 |
commit | bd621cf4cbe731287d6d0aa5352d2d88dbb0fc7c (patch) | |
tree | 71256cfccc9229116d675d810744d11ed5199f39 | |
parent | 6fc0fd2f79d39868b4e41ee63a073e95e8b72c1c (diff) |
make: Reduce color SVG file size with SVGO
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | scfbuild-osx.yml | 2 | ||||
-rw-r--r-- | scfbuild.yml | 2 |
4 files changed, 14 insertions, 6 deletions
@@ -16,9 +16,10 @@ SVG_MORE := assets/svg # Create the lists of traced and color SVGs SVG_FILES := $(wildcard $(SVG_EMOJIONE)/*.svg) $(wildcard $(SVG_MORE)/*.svg) -SVG_TRACE_FILES := $(patsubst $(SVG_EMOJIONE)/%.svg, build/svg-trace/%.svg, $(SVG_FILES)) -SVG_TRACE_FILES := $(patsubst $(SVG_MORE)/%.svg, build/svg-trace/%.svg, $(SVG_TRACE_FILES)) -SVG_COLOR_FILES := $(patsubst build/svg-trace/%.svg, build/staging/%.svg, $(SVG_TRACE_FILES)) +SVG_STAGE_FILES := $(patsubst $(SVG_EMOJIONE)/%.svg, build/stage/%.svg, $(SVG_FILES)) +SVG_STAGE_FILES := $(patsubst $(SVG_MORE)/%.svg, build/stage/%.svg, $(SVG_STAGE_FILES)) +SVG_TRACE_FILES := $(patsubst build/stage/%.svg, build/svg-trace/%.svg, $(SVG_STAGE_FILES)) +SVG_COLOR_FILES := $(patsubst build/stage/%.svg, build/svg-color/%.svg, $(SVG_STAGE_FILES)) all: $(OUTPUT_FONT) @@ -37,9 +38,12 @@ build/svg-trace/%.svg: build/staging/%.svg | build/svg-trace rm $(TMP)/$(*F).png mkbitmap -g -s 1 -f 10 -o $(TMP)/$(*F).pgm $(TMP)/$(*F).bmp rm $(TMP)/$(*F).bmp - potrace -s --height 2048pt --width 2048pt -o $@ $(TMP)/$(*F).pgm + potrace --flat -s --height 2048pt --width 2048pt -o $@ $(TMP)/$(*F).pgm rm $(TMP)/$(*F).pgm +build/svg-color/%.svg: build/staging/%.svg | build/svg-color + svgo -i $< -o $@ + # Copy the files from multiple directories into one source directory build/staging/%.svg: $(SVG_EMOJIONE)/%.svg | build/staging cp $< $@ @@ -57,5 +61,8 @@ build/staging: | build build/svg-trace: | build mkdir build/svg-trace +build/svg-color: | build + mkdir build/svg-color + clean: rm -rf build @@ -163,6 +163,7 @@ Required applications: * potrace * FontTools * FontForge +* SVGO * [SCFBuild][10] *(created for this project!)* * make diff --git a/scfbuild-osx.yml b/scfbuild-osx.yml index cc4f389..05abe17 100644 --- a/scfbuild-osx.yml +++ b/scfbuild-osx.yml @@ -2,7 +2,7 @@ output_file: build/EmojiOneColor-SVGinOT-OSX.ttf verbose: False glyph_svg_dir: build/svg-trace -color_svg_dir: build/staging +color_svg_dir: build/svg-color # Translate the SVGs on import into glyphs. # y+150 for correct emoji-only vertical alignment. glyph_translate_x: 0 diff --git a/scfbuild.yml b/scfbuild.yml index de46a7a..e7eb0e9 100644 --- a/scfbuild.yml +++ b/scfbuild.yml @@ -2,7 +2,7 @@ output_file: build/EmojiOneColor-SVGinOT.ttf verbose: False glyph_svg_dir: build/svg-trace -color_svg_dir: build/staging +color_svg_dir: build/svg-color # Translate the SVGs on import into glyphs. # y+150 for correct emoji-only vertical alignment. glyph_translate_x: 0 |