From a62c0be851e01a637b7996c5805d0f0a97a4dc5f Mon Sep 17 00:00:00 2001 From: Doug Felt Date: Fri, 10 Feb 2017 17:57:24 -0800 Subject: [PATCH] Add GSUB substitutions to provide unknown flag for pairs of RIS. A current issue in Harfbuzz requires that you not perform a delete on index 1 before running a lookup on index 0. --- Makefile | 4 +- NotoColorEmoji.tmpl.ttx.tmpl | 239 ++++++++++++++++++++++++-- third_party/color_emoji/add_glyphs.py | 19 +- 3 files changed, 235 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 119383cc4..7f6835769 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ $(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR) @convert -extent 136x128 -gravity center -background none "$<" "$@" flag-symlinks: $(RESIZED_FLAG_FILES) | $(RENAMED_FLAGS_DIR) - $(subst ^, , \ + @$(subst ^, , \ $(join \ $(FLAGS:%=ln^-fs^../resized_flags/%.png^), \ $(RENAMED_FLAG_FILES:%=%; ) \ @@ -213,7 +213,7 @@ clean: rm -rf $(BUILD_DIR) .SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \ - $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES) NotoColorEmoji.tmpl.ttx + $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES) .PHONY: clean flags emoji renamed_flags quantized compressed check_compress_tool diff --git a/NotoColorEmoji.tmpl.ttx.tmpl b/NotoColorEmoji.tmpl.ttx.tmpl index 6811f5c34..a2ae62b7e 100644 --- a/NotoColorEmoji.tmpl.ttx.tmpl +++ b/NotoColorEmoji.tmpl.ttx.tmpl @@ -1,5 +1,5 @@ - + @@ -47,6 +47,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -71,7 +97,7 @@ - + @@ -93,7 +119,7 @@ - + @@ -144,8 +170,8 @@ - - + + @@ -157,7 +183,7 @@ - + @@ -205,6 +231,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -253,6 +305,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -337,18 +415,18 @@ - + + - + - @@ -359,6 +437,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -399,7 +503,6 @@ - @@ -495,7 +598,7 @@ - + @@ -507,6 +610,7 @@ + @@ -516,6 +620,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/color_emoji/add_glyphs.py b/third_party/color_emoji/add_glyphs.py index aba1facf8..5ab52f35c 100644 --- a/third_party/color_emoji/add_glyphs.py +++ b/third_party/color_emoji/add_glyphs.py @@ -160,7 +160,7 @@ glyph_names = set() ligatures = {} def add_lig_sequence(ligatures, seq, n): - # We have emoji sequences using regional indicator symbols, + # We have emoji sequences using regional indicator symbols, tags, # ZWJ, fitzpatrick modifiers, and combinations of ZWJ and fitzpatrick # modifiers. Currently, Harfbuzz special-cases the fitzpatrick # modifiers to treat them as combining marks instead of as Other @@ -169,10 +169,10 @@ def add_lig_sequence(ligatures, seq, n): # emoji sequences in an RTL context we need GSUB sequences that match # this order. # Regional indicator symbols are LTR, and emoji+fitzpatrick are - # effectively LTR, so we only reorder sequences with ZWJ. If however - # the ZWJ sequence has fitzpatrick modifiers, those need to still follow - # the emoji they logically follow, so simply reversing the sequence - # doesn't work. This code assumes the lig sequence is valid. + # effectively LTR, so we only reorder sequences with ZWJ or tags. If + # however the ZWJ sequence has fitzpatrick modifiers, those need to + # still follow the emoji they logically follow, so simply reversing the + # sequence doesn't work. This code assumes the lig sequence is valid. tseq = tuple(seq) if tseq in ligatures: print 'lig sequence %s, replace %s with %s' % ( @@ -261,15 +261,6 @@ if have_flags: name = _reg_lig_name(flag_to) add_lig_sequence(ligatures, seq, name) - print 'Adding unused flag sequences' - # every flag sequence we don't have gets the missing flag glyph - for first in regional_names: - for second in regional_names: - seq = (first, second) - if seq not in ligatures: - add_lig_sequence(ligatures, seq, UNKNOWN_FLAG_GLYPH_NAME) - - keyed_ligatures = collections.defaultdict(list) for k, v in ligatures.iteritems(): first = k[0]