Merge pull request #295 from googlefonts/fontchain_lint2

Make noto-emoji capable of producing a font that passes Android fontchain_lint
pull/303/head
rsheeter 2020-03-16 22:54:44 -07:00 committed by GitHub
commit edb6a9b991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 26 deletions

View File

@ -214,23 +214,26 @@ def get_rtl_seq(seq):
"""Return the rtl variant of the sequence, if it has one, else the empty
sequence.
"""
# Sequences with ZWJ or TAG_END in them will reflect. Fitzpatrick modifiers
# Sequences with ZWJ in them will reflect. Fitzpatrick modifiers
# however do not, so if we reflect we make a pass to swap them back into their
# logical order.
# Used to check for TAG_END 0xe007f as well but Android fontchain_lint
# dislikes the resulting mangling of flags for England, Scotland, Wales.
ZWJ = 0x200d
TAG_END = 0xe007f
def is_fitzpatrick(cp):
return 0x1f3fb <= cp <= 0x1f3ff
if not (ZWJ in seq or TAG_END in seq):
if ZWJ not in seq:
return ()
rev_seq = list(seq)
rev_seq.reverse()
for i in range(len(rev_seq)-1, 0, -1):
for i in range(1, len(rev_seq)):
if is_fitzpatrick(rev_seq[i-1]):
rev_seq[i-1], rev_seq[i] = rev_seq[i], rev_seq[i-1]
tmp = rev_seq[i]
rev_seq[i] = rev_seq[i-1]
rev_seq[i-1] = tmp
return tuple(rev_seq)

View File

@ -13,24 +13,3 @@ fe82b;unknown_flag # no name -> no name
1f1f2_1f1eb;1f1eb_1f1f7 # MF -> FR
1f1f8_1f1ef;1f1f3_1f1f4 # SJ -> NO
1f1fa_1f1f2;1f1fa_1f1f8 # UM -> US
# People holding hands
# Adds sequence for emoji that also have dedicated Unicode values
1f468_200d_1f91d_200d_1f468;1f46c
1f468_1f3fb_200d_1f91d_200d_1f468_1f3fb;1f46c_1f3fb
1f468_1f3fc_200d_1f91d_200d_1f468_1f3fc;1f46c_1f3fc
1f468_1f3fd_200d_1f91d_200d_1f468_1f3fd;1f46c_1f3fd
1f468_1f3fe_200d_1f91d_200d_1f468_1f3fe;1f46c_1f3fe
1f468_1f3ff_200d_1f91d_200d_1f468_1f3ff;1f46c_1f3ff
1f469_200d_1f91d_200d_1f468;1f46b
1f469_1f3fb_200d_1f91d_200d_1f468_1f3fb;1f46b_1f3fb
1f469_1f3fc_200d_1f91d_200d_1f468_1f3fc;1f46b_1f3fc
1f469_1f3fd_200d_1f91d_200d_1f468_1f3fd;1f46b_1f3fd
1f469_1f3fe_200d_1f91d_200d_1f468_1f3fe;1f46b_1f3fe
1f469_1f3ff_200d_1f91d_200d_1f468_1f3ff;1f46b_1f3ff
1f469_200d_1f91d_200d_1f469;1f46d
1f469_1f3fb_200d_1f91d_200d_1f469_1f3fb;1f46d_1f3fb
1f469_1f3fc_200d_1f91d_200d_1f469_1f3fc;1f46d_1f3fc
1f469_1f3fd_200d_1f91d_200d_1f469_1f3fd;1f46d_1f3fd
1f469_1f3fe_200d_1f91d_200d_1f469_1f3fe;1f46d_1f3fe
1f469_1f3ff_200d_1f91d_200d_1f469_1f3ff;1f46d_1f3ff