Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/13rac1/emojione-color-font.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Erickson <eosrei@gmail.com>2016-02-19 12:01:33 +0300
committerBrad Erickson <eosrei@gmail.com>2016-02-19 12:01:33 +0300
commit66d327a747ee38f996c8869cede45573b714018d (patch)
tree3def9939862908d76b432dac1390161b7cbefa54
parentb206d4635e23e955e1fde80c26cacaff5f837e1b (diff)
make: Add staging to combine two SVG sources
-rw-r--r--.gitignore2
-rw-r--r--.gitmodules2
-rw-r--r--Makefile49
m---------assets/emojione0
4 files changed, 38 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f4a9659
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build
+SMFBuild
diff --git a/.gitmodules b/.gitmodules
index 61d7071..4860e20 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
[submodule "assets/emojione"]
path = assets/emojione
- url = https://github.com/Ranks/emojione.git
+ url = https://github.com/eosrei/emojione.git
diff --git a/Makefile b/Makefile
index dd7b200..5dc0ffd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,29 @@
# Run with: make -j [NUMBER_OF_CPUS]
-SVG_SOURCE := assets/emojione/assets/svg
-SVG_FILES := $(wildcard $(SVG_SOURCE)/*.svg)
-SVG_TRACE_FILES := $(patsubst $(SVG_SOURCE)/%.svg, build/svg-trace/%.svg, $(SVG_FILES))
+.PHONY: clean
-# Use the default Linux ramdisk, change for other systems or testing.
-TMP := /dev/shm/emojione
+OUTPUT_FONT := build/EmojiOne-SVGinOT.ttf
+SMFBUILD := SMFBuild/bin/smfbuild
-.PHONY: build clean
+TMP := /tmp
+# Use Linux Shared Memory to avoid wasted disk writes.
+#TMP := /dev/shm
-all: EmojiOne-SVGinOT.ttf
+# There are two SVG source directories to keep the emojione assets separate.
+SVG_EMOJIONE := assets/emojione/assets/svg
+SVG_MORE := assets/svg
-EmojiOne-SVGinOT.ttf: build $(SVG_TRACE_FILES)
- echo "done!"
+# 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))
+
+all: $(OUTPUT_FONT)
+
+$(OUTPUT_FONT): $(SVG_TRACE_FILES) $(SVG_COLOR_FILES)
+ $(SMFBUILD) build/svg-trace $(OUTPUT_FONT) --color-svg-dir=build/staging --transform="translate(0 -800) scale(1.0)"
# Create black SVG traces of the color SVGs to use as glyphs.
# 1. Make the EmojiOne SVG into a PNG with Inkscape
@@ -21,20 +31,31 @@ EmojiOne-SVGinOT.ttf: build $(SVG_TRACE_FILES)
# canvas size to allow the outer "stroke" to fit.
# 3. Make the BMP into a Edge Detected PGM with mkbitmap
# 4. Make the PGM into a black SVG trace with potrace
-build/svg-trace/%.svg: $(SVG_SOURCE)/%.svg
+build/svg-trace/%.svg: build/staging/%.svg | build/svg-trace
inkscape -w 1000 -h 1000 -z -e $(TMP)/$(*F).png $<
- convert $(TMP)/$(*F).png -gravity center -background xc:transparent -extent 1066x1066 $(TMP)/$(*F).bmp
+ convert $(TMP)/$(*F).png -gravity center -extent 1066x1066 $(TMP)/$(*F).bmp
rm $(TMP)/$(*F).png
mkbitmap -g -s 1 -f 10 -o $(TMP)/$(*F).pgm $(TMP)/$(*F).bmp
rm $(TMP)/$(*F).bmp
potrace -s --height 1000pt --width 1000pt -o $@ $(TMP)/$(*F).pgm
rm $(TMP)/$(*F).pgm
+# Copy the files from multiple directories into one source directory
+build/staging/%.svg: $(SVG_EMOJIONE)/%.svg | build/staging
+ cp $< $@
+
+build/staging/%.svg: $(SVG_MORE)/%.svg | build/staging
+ cp $< $@
+
# Create the build directories
build:
- mkdir -p $(TMP)
- mkdir -p build
- mkdir -p build/svg-trace
+ mkdir build
+
+build/staging: | build
+ mkdir build/staging
+
+build/svg-trace: | build
+ mkdir build/svg-trace
clean:
rm -rf build
diff --git a/assets/emojione b/assets/emojione
-Subproject f466fac02438048ade018b8fda9d8c0d9cb6041
+Subproject 8a9998b02fe96e468e1776507eff2d3f6bff48a