Skip to content

Commit

Permalink
Capture changes to fix fontchain_lint on top of master log
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Mar 17, 2020
1 parent 4325631 commit 28678e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
13 changes: 8 additions & 5 deletions add_glyphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
21 changes: 0 additions & 21 deletions emoji_aliases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 28678e5

Please sign in to comment.