Skip to content
Snippets Groups Projects
Commit c1808631 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

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
parent 82db2614
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment