[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed May 17 18:33:02 UTC 2017


 src/hb-ot-layout-gsubgpos-private.hh                                    |    2 -
 src/hb-ot-layout-private.hh                                             |   13 ++++++----
 test/shaping/Makefile.am                                                |    1 
 test/shaping/fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf |binary
 test/shaping/tests/emoji-flag-tags.tests                                |    2 +
 5 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 06cfe3f7369684fc05fa16da7f6778350f8bcba5
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Wed May 17 21:32:47 2017 +0300

    Do not skip TAG characters in glyph substitution (#487)
    
    Hide them like Mongolian Free Variation Selectors instead.
    
    Fixes https://github.com/behdad/harfbuzz/issues/463

diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 921859a6..f77f5d98 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -319,7 +319,7 @@ struct hb_apply_context_t :
       if (!c->check_glyph_property (&info, lookup_props))
 	return SKIP_YES;
 
-      if (unlikely (_hb_glyph_info_is_default_ignorable_and_not_fvs (&info) &&
+      if (unlikely (_hb_glyph_info_is_default_ignorable_and_not_hidden (&info) &&
 		    (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
 		    (ignore_zwj || !_hb_glyph_info_is_zwj (&info))))
 	return SKIP_MAYBE;
diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh
index 071a439d..b476339e 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout-private.hh
@@ -240,7 +240,8 @@ _next_syllable (hb_buffer_t *buffer, unsigned int start)
 enum hb_unicode_props_flags_t {
   UPROPS_MASK_GEN_CAT	= 0x001Fu,
   UPROPS_MASK_IGNORABLE	= 0x0020u,
-  UPROPS_MASK_FVS	= 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..3 */
+  UPROPS_MASK_HIDDEN	= 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..3,
+                                    * or TAG characters */
 
   /* If GEN_CAT=FORMAT, top byte masks: */
   UPROPS_MASK_Cf_ZWJ	= 0x0100u,
@@ -273,7 +274,11 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
        * Fixes:
        * https://github.com/behdad/harfbuzz/issues/234
        */
-      if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_FVS;
+      if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_HIDDEN;
+      /* TAG characters need similar treatment. Fixes:
+       * https://github.com/behdad/harfbuzz/issues/463
+       */
+      if (unlikely (hb_in_range (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
     }
     else if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL (gen_cat)))
     {
@@ -373,9 +378,9 @@ _hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
 	 !_hb_glyph_info_ligated (info);
 }
 static inline hb_bool_t
-_hb_glyph_info_is_default_ignorable_and_not_fvs (const hb_glyph_info_t *info)
+_hb_glyph_info_is_default_ignorable_and_not_hidden (const hb_glyph_info_t *info)
 {
-  return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_FVS))
+  return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_HIDDEN))
 	  == UPROPS_MASK_IGNORABLE) &&
 	 !_hb_glyph_info_ligated (info);
 }
diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index 89578e10..ab25a50a 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -50,6 +50,7 @@ TESTS = \
 	tests/context-matching.tests \
 	tests/cursive-positioning.tests \
 	tests/default-ignorables.tests \
+	tests/emoji-flag-tags.tests \
 	tests/fallback-positioning.tests \
 	tests/fuzzed.tests \
 	tests/hangul-jamo.tests \
diff --git a/test/shaping/fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf b/test/shaping/fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf
new file mode 100644
index 00000000..d7f2bdb0
Binary files /dev/null and b/test/shaping/fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf differ
diff --git a/test/shaping/tests/emoji-flag-tags.tests b/test/shaping/tests/emoji-flag-tags.tests
new file mode 100644
index 00000000..9b6da778
--- /dev/null
+++ b/test/shaping/tests/emoji-flag-tags.tests
@@ -0,0 +1,2 @@
+fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf::U+1F3F4,U+E0055,U+E0053,U+E0064,U+E0065,U+E007F:[u1F3F4=0+2126|space=1+0|space=2+0|space=3+0|space=4+0|space=5+0]
+fonts/sha1sum/53374c7ca3657be37efde7ed02ae34229a56ae1f.ttf::U+1F3F4,U+E0064,U+E0065,U+E007F:[de=0+3200]


More information about the HarfBuzz mailing list