Add flags for 200+ regions.
This change also reorganized how the NotoColorEmoji font is created.pull/13/head
103
Makefile
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright 2014 Google Inc. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -14,29 +12,9 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
EMOJI = NotoColorEmoji
|
||||
EMOJI_PNG128 = ./png/128/emoji_u
|
||||
EMOJI_PNG64 = ./png/64/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_PNG64)%.png: $(EMOJI_PNG128)%.png
|
||||
convert -geometry 50% "$<" "$@"
|
||||
optipng -o7 "$@"
|
||||
|
||||
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI)
|
||||
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"
|
||||
|
||||
%.ttf: %.ttx
|
||||
@rm -f "$@"
|
||||
ttx "$<"
|
||||
|
||||
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) $(EMOJI_PNG128)*.png $(EMOJI_PNG64)*.png
|
||||
python $(EMOJI_BUILDER) -V $< "$@" $(EMOJI_PNG128) $(EMOJI_PNG64)
|
||||
python $(PUA_ADDER) "$@" "$@-with-pua"
|
||||
mv "$@-with-pua" "$@"
|
||||
font: $(EMOJI).ttf
|
||||
|
||||
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
||||
LDFLAGS = `pkg-config --libs cairo`
|
||||
|
@ -44,6 +22,81 @@ LDFLAGS = `pkg-config --libs cairo`
|
|||
waveflag: waveflag.c
|
||||
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
FLAGS = AD AE AF AG AI AL AM AO AR AS AT AU AW AX AZ \
|
||||
BA BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BW BY BZ \
|
||||
CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ \
|
||||
DE DJ DK DM DO DZ \
|
||||
EC EE EG ER ES ET EU \
|
||||
FI FJ FM FO FR \
|
||||
GA GB GD GE GG GH GI GL GM GN GQ GR GT GU GW GY \
|
||||
HK HN HR HT HU \
|
||||
ID IE IL IM IN IO IQ IR IS IT \
|
||||
JE JM JO JP \
|
||||
KE KG KH KI KM KN KP KR KW KY KZ \
|
||||
LA LB LC LI LK LR LS LT LU LV LY \
|
||||
MA MC MD ME MG MH MK ML MM MN MO MP MR MS MT MU MV MW MX MY MZ \
|
||||
NA NE NF NG NI NL NO NP NR NU NZ \
|
||||
OM \
|
||||
PA PE PF PG PH PK PL PN PR PS PT PW PY \
|
||||
QA \
|
||||
RO RS RU RW \
|
||||
SA SB SC SD SE SG SI SK SL SM SN SO SR SS ST SV SX SY SZ \
|
||||
TC TD TG TH TJ TK TL TM TN TO TR TT TV TW TZ \
|
||||
UA UG US UY UZ \
|
||||
VA VC VE VG VI VN VU \
|
||||
WS \
|
||||
YE \
|
||||
ZA ZM ZW
|
||||
|
||||
FLAGS_SRC_DIR = ../third_party/region-flags/png
|
||||
FLAGS_DIR = ./flags
|
||||
|
||||
glyph_name = $(shell ./flag_glyph_name.py $(flag))
|
||||
|
||||
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
|
||||
PNG128_FLAGS := $(foreach flag,$(FLAGS),$(addprefix ./png/128/emoji_$(glyph_name),.png))
|
||||
PNG64_FLAGS := $(foreach flag,$(FLAGS),$(addprefix ./png/64/emoji_,$(glyph_name).png))
|
||||
|
||||
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag
|
||||
mkdir -p $(FLAGS_DIR)
|
||||
./waveflag "$<" "$@"
|
||||
optipng -quiet -o7 "$@"
|
||||
|
||||
flag-symlinks: $(WAVED_FLAGS)
|
||||
$(foreach flag,$(FLAGS),ln -fs ../../flags/$(flag).png ./png/128/emoji_$(glyph_name).png;)
|
||||
|
||||
$(PNG64_FLAGS): $(PNG128_FLAGS)
|
||||
|
||||
$(PNG128_FLAGS): flag-symlinks
|
||||
|
||||
EMOJI_PNG128 = ./png/128/emoji_u
|
||||
EMOJI_PNG64 = ./png/64/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_PNG64)%.png: $(EMOJI_PNG128)%.png
|
||||
convert -geometry 50% "$<" "$@"
|
||||
optipng -quiet -o7 "$@"
|
||||
|
||||
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI) flag-symlinks
|
||||
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"
|
||||
|
||||
%.ttf: %.ttx
|
||||
@rm -f "$@"
|
||||
ttx "$<"
|
||||
|
||||
PNG64_IMAGES := $(patsubst $(EMOJI_PNG128)%,$(EMOJI_PNG64)%,$(wildcard $(EMOJI_PNG128)*.png)) $(PNG64_FLAGS)
|
||||
|
||||
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) $(PNG64_IMAGES) $(EMOJI_PNG128)*.png flag-symlinks
|
||||
python $(EMOJI_BUILDER) -V $< "$@" $(EMOJI_PNG128) $(EMOJI_PNG64)
|
||||
python $(PUA_ADDER) "$@" "$@-with-pua"
|
||||
mv "$@-with-pua" "$@"
|
||||
|
||||
clean:
|
||||
rm -f waveflag
|
||||
rm -f $(EMOJI).ttf $(EMOJI).tmpl.ttf $(EMOJI).tmpl.ttx
|
||||
rm -f $(EMOJI_PNG64)*.png
|
||||
rm -f waveflag
|
||||
rm -rf $(FLAGS_DIR)
|
||||
rm -f `find -type l -name "*.png"`
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="1.01"/>
|
||||
<fontRevision value="1.11"/>
|
||||
<checkSumAdjustment value="0x4d5a161a"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00001011"/>
|
||||
|
@ -145,7 +145,7 @@
|
|||
Noto Color Emoji
|
||||
</namerecord>
|
||||
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
|
||||
Version 1.01
|
||||
Version 1.11
|
||||
</namerecord>
|
||||
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
|
||||
NotoColorEmoji
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright 2014 Google Inc. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Generate a glyph name for flag emojis."""
|
||||
|
||||
__author__ = 'roozbeh@google.com (Roozbeh Pournader)'
|
||||
|
||||
import sys
|
||||
|
||||
from nototools import add_emoji_gsub
|
||||
|
||||
def two_letter_code_to_glyph_name(iso_code):
|
||||
return 'u%04x_%04x' % (
|
||||
add_emoji_gsub.reg_indicator(iso_code[0]),
|
||||
add_emoji_gsub.reg_indicator(iso_code[1]))
|
||||
|
||||
def main():
|
||||
print ' '.join([
|
||||
two_letter_code_to_glyph_name(iso_code) for iso_code in sys.argv[1:]])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 694 B After Width: | Height: | Size: 694 B |
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 689 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 940 B After Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 912 B |
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 684 B After Width: | Height: | Size: 684 B |
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 863 B |
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 747 B |
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 580 B |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |