mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2025-06-08 07:47:59 +00:00
Add 'unknown flag' glyph.
This uses PUA character U+FE82B for the unknown flag during processing. Currently I don't yet remove this from the cmap when we're done.
This commit is contained in:
parent
3a57df2ac6
commit
343e9ffbf4
3 changed files with 11 additions and 4 deletions
2
Makefile
2
Makefile
|
@ -43,6 +43,8 @@ RENAMED_FLAGS_DIR := $(BUILD_DIR)/renamed_flags
|
||||||
QUANTIZED_DIR := $(BUILD_DIR)/quantized_pngs
|
QUANTIZED_DIR := $(BUILD_DIR)/quantized_pngs
|
||||||
COMPRESSED_DIR := $(BUILD_DIR)/compressed_pngs
|
COMPRESSED_DIR := $(BUILD_DIR)/compressed_pngs
|
||||||
|
|
||||||
|
# Unknown flag is PUA fe82b
|
||||||
|
|
||||||
LIMITED_FLAGS = CN DE ES FR GB IT JP KR RU US
|
LIMITED_FLAGS = CN DE ES FR GB IT JP KR RU US
|
||||||
SELECTED_FLAGS = AC AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ \
|
SELECTED_FLAGS = AC AD AE AF AG AI AL AM AO AQ 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 \
|
BA BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BW BY BZ \
|
||||||
|
|
BIN
png/128/emoji_ufe82b.png
Normal file
BIN
png/128/emoji_ufe82b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
13
third_party/color_emoji/add_glyphs.py
vendored
13
third_party/color_emoji/add_glyphs.py
vendored
|
@ -5,8 +5,9 @@ from fontTools import ttx
|
||||||
from fontTools.ttLib.tables import otTables
|
from fontTools.ttLib.tables import otTables
|
||||||
from png import PNG
|
from png import PNG
|
||||||
|
|
||||||
# TODO: replace with actual name once we have a glyph.
|
# PUA character for unknown flag. This avoids the legacy emoji pua values, but
|
||||||
MISSING_FLAG_GLYPH_NAME = "u2764"
|
# is in the same area.
|
||||||
|
UNKNOWN_FLAG_GLYPH_NAME = "uFE82B"
|
||||||
|
|
||||||
sys.path.append(
|
sys.path.append(
|
||||||
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
|
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
|
||||||
|
@ -166,9 +167,9 @@ def add_lig_sequence(ligatures, seq, n):
|
||||||
|
|
||||||
|
|
||||||
for (u, filename) in img_pairs:
|
for (u, filename) in img_pairs:
|
||||||
# print "Adding glyph for U+%s" % ",".join (["%04X" % ord (char) for char in u])
|
|
||||||
n = glyph_name (u)
|
n = glyph_name (u)
|
||||||
glyph_names.add(n)
|
glyph_names.add(n)
|
||||||
|
# print "Adding glyph for %s" % n
|
||||||
|
|
||||||
g.append (n)
|
g.append (n)
|
||||||
for char in u:
|
for char in u:
|
||||||
|
@ -205,6 +206,10 @@ for k in ligatures:
|
||||||
have_flags = True
|
have_flags = True
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if have_flags and UNKNOWN_FLAG_GLYPH_NAME not in glyph_names:
|
||||||
|
raise ValueError(
|
||||||
|
'Have flags but no unknown flag glyph "%s"' % UNKNOWN_FLAG_GLYPH_NAME)
|
||||||
|
|
||||||
# sigh, too many separate files with the same code.
|
# sigh, too many separate files with the same code.
|
||||||
# copied from add_emoji_gsub.
|
# copied from add_emoji_gsub.
|
||||||
def _reg_indicator(letter):
|
def _reg_indicator(letter):
|
||||||
|
@ -233,7 +238,7 @@ if have_flags:
|
||||||
for second in regional_names:
|
for second in regional_names:
|
||||||
seq = (first, second)
|
seq = (first, second)
|
||||||
if seq not in ligatures:
|
if seq not in ligatures:
|
||||||
add_lig_sequence(ligatures, seq, MISSING_FLAG_GLYPH_NAME)
|
add_lig_sequence(ligatures, seq, UNKNOWN_FLAG_GLYPH_NAME)
|
||||||
|
|
||||||
|
|
||||||
keyed_ligatures = collections.defaultdict(list)
|
keyed_ligatures = collections.defaultdict(list)
|
||||||
|
|
Loading…
Add table
Reference in a new issue