Merge remote-tracking branch 'upstream/master'

pull/16/head
Doug Felt 2015-09-25 14:29:25 -07:00
commit 4d3b32cf92
11 changed files with 33 additions and 28 deletions

View File

@ -18,12 +18,12 @@ font: $(EMOJI).ttf
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
LDFLAGS = `pkg-config --libs cairo`
PNGQUANTDIR := $(abspath `pwd`/../../third_party/pngquant)
PNGQUANTDIR := $(abspath `pwd`/../third_party/pngquant)
PNGQUANT := $(PNGQUANTDIR)/pngquant
PNGQUANTFLAGS = --speed 1 --skip-if-larger --ext '.png' --force
$(PNGQUANT):
cd $(PNGQUANTDIR) && make
"$(PNGQUANT)":
cd "$(PNGQUANTDIR)" && make
waveflag: waveflag.c
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
@ -55,30 +55,34 @@ FLAGS = AD AE AF AG AI AL AM AO AR AS AT AU AW AX AZ \
YE \
ZA ZM ZW
FLAGS_SRC_DIR = ../third_party/region-flags/png
FLAGS_SRC_DIR = third_party/region-flags/png
FLAGS_DIR = ./flags
glyph_name = $(shell ./flag_glyph_name.py $(flag))
GLYPH_NAMES := $(shell ./flag_glyph_name.py $(FLAGS))
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
PNG128_FLAGS := $(foreach flag,$(FLAGS),$(addprefix ./png/128/emoji_$(glyph_name),.png))
PNG128_FLAGS := $(foreach glyph_name,$(GLYPH_NAMES),$(addprefix ./png/128/emoji_$(glyph_name),.png))
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag $(PNGQUANT)
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag "$(PNGQUANT)"
mkdir -p $(FLAGS_DIR)
./waveflag "$<" "$@"
optipng -quiet -o7 "$@"
$(PNGQUANT) $(PNGQUANTFLAGS) "$@"
"$(PNGQUANT)" $(PNGQUANTFLAGS) "$@"
flag-symlinks: $(WAVED_FLAGS)
$(foreach flag,$(FLAGS),ln -fs ../../flags/$(flag).png ./png/128/emoji_$(glyph_name).png;)
$(subst ^, , \
$(join \
$(FLAGS:%=ln^-fs^../../flags/%.png^), \
$(GLYPH_NAMES:%=./png/128/emoji_%.png;) \
) \
)
$(PNG128_FLAGS): flag-symlinks
EMOJI_PNG128 = ./png/128/emoji_u
EMOJI_BUILDER = ../third_party/color_emoji/emoji_builder.py
ADD_GLYPHS = ../third_party/color_emoji/add_glyphs.py
PUA_ADDER = ../nototools/map_pua_emoji.py
EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py
ADD_GLYPHS = third_party/color_emoji/add_glyphs.py
PUA_ADDER = map_pua_emoji.py
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI) flag-symlinks
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright 2015 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -33,8 +33,8 @@ from fontTools.ttLib.tables import otTables
from fontTools.ttLib.tables import _g_l_y_f
from fontTools.ttLib.tables import S_V_G_ as SVG
from fontTools import ttx
from nototools import add_emoji_gsub
import add_emoji_gsub
import svg_builder
import svg_cleaner

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright 2015 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
@ -20,7 +20,7 @@ __author__ = 'roozbeh@google.com (Roozbeh Pournader)'
import sys
from nototools import add_emoji_gsub
import add_emoji_gsub
def two_letter_code_to_glyph_name(iso_code):
return 'u%04x_%04x' % (

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright 2015 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
@ -22,9 +22,10 @@ import sys
from fontTools import ttLib
from nototools import add_emoji_gsub
from nototools import font_data
import add_emoji_gsub
def get_glyph_name_from_gsub(char_seq, font):
"""Find the glyph name for ligature of a given character sequence from GSUB.

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright 2015 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,12 +1,12 @@
#!/usr/bin/python
#!/usr/bin/env python
import glob, sys
from fontTools import ttx
from fontTools.ttLib.tables import otTables
from png import PNG
sys.path.append('../../nototools')
from nototools import add_emoji_gsub
sys.path.append('../../')
import add_emoji_gsub
def glyph_name(string):

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2013 Google, Inc. All Rights Reserved.
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2013 Google, Inc. All Rights Reserved.
#