Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses much of the code/config from the the Emoji One Color font. Seems to work correctly, but needs further testing.
- Loading branch information
Showing
5 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
SCFBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Makefile to create all versions of the Twitter Color Emoji SVGinOT font | ||
# Run with: make -j [NUMBER_OF_CPUS] | ||
|
||
TMP := /tmp | ||
# Use Linux Shared Memory to avoid wasted disk writes. | ||
#TMP := /dev/shm | ||
|
||
# Where to find scfbuild? | ||
SCFBUILD := SCFBuild/bin/scfbuild | ||
|
||
VERSION := 1.0-alpha | ||
FONT_PREFIX := build/TwitterColorEmoji-SVGinOT | ||
REGULAR_FONT := $(FONT_PREFIX).ttf | ||
REGULAR_ZIP := $(FONT_PREFIX)-$(VERSION).zip | ||
|
||
# There are two SVG source directories to keep the assets separate. | ||
SVG_TWEMOJI := assets/twemoji-svg | ||
# Currently empty | ||
SVG_MORE := assets/svg | ||
|
||
# Create the lists of traced and color SVGs | ||
SVG_FILES := $(wildcard $(SVG_TWEMOJI)/*.svg) $(wildcard $(SVG_MORE)/*.svg) | ||
SVG_STAGE_FILES := $(patsubst $(SVG_TWEMOJI)/%.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)) | ||
|
||
.PHONY: all package clean | ||
|
||
all: $(REGULAR_FONT) | ||
|
||
package: all | ||
rm -f $(REGULAR_ZIP) | ||
7z a -tzip -mx=9 $(REGULAR_ZIP) ./$(REGULAR_FONT) | ||
|
||
$(REGULAR_FONT): $(SVG_TRACE_FILES) $(SVG_COLOR_FILES) | ||
$(SCFBUILD) -c scfbuild.yml -o $(REGULAR_FONT) --font-version="$(VERSION)" | ||
|
||
# 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 and add margin by increasing the | ||
# 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: build/staging/%.svg | build/svg-trace | ||
inkscape -w 1000 -h 1000 -z -e $(TMP)/$(*F).png $< | ||
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 --flat -s --height 2048pt --width 2048pt -o $@ $(TMP)/$(*F).pgm | ||
rm $(TMP)/$(*F).pgm | ||
|
||
# Optimize/clean the color SVG files | ||
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_TWEMOJI)/%.svg | build/staging | ||
cp $< $@ | ||
|
||
build/staging/%.svg: $(SVG_MORE)/%.svg | build/staging | ||
cp $< $@ | ||
|
||
# Create the build directories | ||
build: | ||
mkdir build | ||
|
||
build/staging: | build | ||
mkdir build/staging | ||
|
||
build/svg-trace: | build | ||
mkdir build/svg-trace | ||
|
||
build/svg-color: | build | ||
mkdir build/svg-color | ||
|
||
clean: | ||
rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SCFBuild configuration file for Twitter Color Emoji | ||
output_file: build/TwitterEmojiColor-SVGinOT.ttf | ||
verbose: False | ||
glyph_svg_dir: build/svg-trace | ||
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 | ||
glyph_translate_y: 150 | ||
# The SVGs are 45x45. They are scaled to 1000x1000 by the Firefox renderer, but | ||
# need adjustment to line up correctly. 8/10*2048 = 1638 = Default font ascent. | ||
# y+150 for correct emoji-only vertical alignment. | ||
color_transform: translate(0 -1788) scale(2.048) | ||
table_name: | ||
copyright: > | ||
Copyright 2016 Brad Erickson CC-BY. | ||
Copyright 2016 Twitter, Inc. CC-BY. | ||
family: Twitter Color Emoji | ||
# Subfamily is also called Style or Weight. Often set to: Regular | ||
subfamily: Regular | ||
unique_id: Twitter Color Emoji SVGinOT eosrei.net | ||
full_name: Twitter Color Emoji SVGinOT | ||
#version: | ||
# No spaces in PostScript Names | ||
postscript_name: TwitterColorEmojiSVGinOT | ||
#trademark: | ||
manufacturer: Brad Erickson | ||
designer: Twitter, Inc. | ||
description: > | ||
A SVGinOT color emoji font using the Twitter Emoji for Everyone set: | ||
https://github.com/eosrei/twemoji-color-font/ | ||
url_vendor: https://github.com/eosrei/twemoji-color-font/ | ||
url_designer: https://github.com/twitter/twemoji | ||
license: Creative Commons Attribution 4.0 International | ||
url_license: http://creativecommons.org/licenses/by/4.0/ |