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
diff --git a/tools/fonts/fontchain_linter.py b/tools/fonts/fontchain_linter.py
index ffca466..a8411aa 100755
--- a/tools/fonts/fontchain_linter.py
+++ b/tools/fonts/fontchain_linter.py
@@ -486,12 +486,8 @@
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 @@
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 @@
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)