summaryrefslogtreecommitdiff
path: root/tools/fonts
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2018-05-14 13:39:40 -0700
committerSeigo Nonaka <nona@google.com>2018-05-15 16:09:48 +0000
commitc18086310b3b36f869455c7a63332b3c1fa728b7 (patch)
tree5b1bece8bafbd26bd475e5d39e64dc64158e0a74 /tools/fonts
parent82db2614e450f92e373d0018a5b23d80c13511c2 (diff)
Update font chain linter to match latest font file
- FAMILY emoji now has own gender neutral emoji - Some flags are newly supported - Some regions may have the same flags. Bug: 77148691 Test: m fontchain_lint Change-Id: If1a69974230f025d35503eb49bea105923593e87
Diffstat (limited to 'tools/fonts')
-rwxr-xr-xtools/fonts/fontchain_linter.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/fonts/fontchain_linter.py b/tools/fonts/fontchain_linter.py
index ffca46696a7c..a8411aa5c488 100755
--- a/tools/fonts/fontchain_linter.py
+++ b/tools/fonts/fontchain_linter.py
@@ -486,12 +486,8 @@ def flag_sequence(territory_code):
return tuple(0x1F1E6 + ord(ch) - ord('A') for ch in territory_code)
UNSUPPORTED_FLAGS = frozenset({
- flag_sequence('BL'), flag_sequence('BQ'), flag_sequence('DG'),
- flag_sequence('EA'), flag_sequence('EH'), flag_sequence('FK'),
- flag_sequence('GF'), flag_sequence('GP'), flag_sequence('GS'),
- flag_sequence('MF'), flag_sequence('MQ'), flag_sequence('NC'),
- flag_sequence('PM'), flag_sequence('RE'), flag_sequence('TF'),
- flag_sequence('WF'), flag_sequence('XK'), flag_sequence('YT'),
+ flag_sequence('BL'), flag_sequence('BQ'), flag_sequence('MQ'),
+ flag_sequence('RE'), flag_sequence('TF'),
})
EQUIVALENT_FLAGS = {
@@ -531,10 +527,17 @@ LEGACY_ANDROID_EMOJI = {
ZWJ_IDENTICALS = {
# KISS
(0x1F469, 0x200D, 0x2764, 0x200D, 0x1F48B, 0x200D, 0x1F468): 0x1F48F,
- # FAMILY
- (0x1F468, 0x200D, 0x1F469, 0x200D, 0x1F466): 0x1F46A,
}
+SAME_FLAG_MAPPINGS = [
+ # Diego Garcia and British Indian Ocean Territory
+ ((0x1F1EE, 0x1F1F4), (0x1F1E9, 0x1F1EC)),
+ # St. Martin and France
+ ((0x1F1F2, 0x1F1EB), (0x1F1EB, 0x1F1F7)),
+ # Spain and Ceuta & Melilla
+ ((0x1F1EA, 0x1F1F8), (0x1F1EA, 0x1F1E6)),
+]
+
ZWJ = 0x200D
FEMALE_SIGN = 0x2640
MALE_SIGN = 0x2642
@@ -636,6 +639,9 @@ def compute_expected_emoji():
all_sequences.add(reversed_seq)
equivalent_emoji[reversed_seq] = sequence
+ for first, second in SAME_FLAG_MAPPINGS:
+ equivalent_emoji[first] = second
+
# Remove unsupported flags
all_sequences.difference_update(UNSUPPORTED_FLAGS)