[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Oct 3 19:18:27 UTC 2018


 src/hb-ot-layout.hh |    2 +-
 src/hb-ot-shape.cc  |    9 +++++++--
 src/hb-unicode.hh   |   20 --------------------
 3 files changed, 8 insertions(+), 23 deletions(-)

New commits:
commit b710ea4fdeb1a620b396bd07665fc129fe5fc074
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Oct 3 21:17:59 2018 +0200

    Clean Fitzpatrick hack

diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 921fd810..ac55459b 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -214,7 +214,7 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
 {
   hb_unicode_funcs_t *unicode = buffer->unicode;
   unsigned int u = info->codepoint;
-  unsigned int gen_cat = (unsigned int) unicode->modified_general_category (u);
+  unsigned int gen_cat = (unsigned int) unicode->general_category (u);
   unsigned int props = gen_cat;
 
   if (u >= 0x80)
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 8c90e689..748af969 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -290,8 +290,13 @@ hb_set_unicode_props (hb_buffer_t *buffer)
     _hb_glyph_info_set_unicode_props (&info[i], buffer);
 
     /* Marks are already set as continuation by the above line.
-     * Handle ZWJ-continuation. */
-    if (unlikely (_hb_glyph_info_is_zwj (&info[i])))
+     * Handle Emoji_Modifier and ZWJ-continuation. */
+    if (unlikely (_hb_glyph_info_get_general_category (&info[i]) == HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL &&
+		  hb_in_range<hb_codepoint_t> (info[i].codepoint, 0x1F3FBu, 0x1F3FFu)))
+    {
+	_hb_glyph_info_set_continuation (&info[i]);
+    }
+    else if (unlikely (_hb_glyph_info_is_zwj (&info[i])))
     {
       _hb_glyph_info_set_continuation (&info[i]);
       if (i + 1 < count &&
diff --git a/src/hb-unicode.hh b/src/hb-unicode.hh
index 106fbf0a..6d6a4fa0 100644
--- a/src/hb-unicode.hh
+++ b/src/hb-unicode.hh
@@ -101,26 +101,6 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
     return ret;
   }
 
-
-  inline hb_unicode_general_category_t
-  modified_general_category (hb_codepoint_t u)
-  {
-    hb_unicode_general_category_t cat = general_category (u);
-
-    if (unlikely (cat == HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL))
-    {
-      /* Recategorize emoji skin-tone modifiers as Unicode mark, so they
-       * behave correctly in non-native directionality.  They originally
-       * are MODIFIER_SYMBOL.  Fixes:
-       * https://github.com/harfbuzz/harfbuzz/issues/169
-       */
-      if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1F3FBu, 0x1F3FFu)))
-	cat = HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK;
-    }
-
-    return cat;
-  }
-
   inline unsigned int
   modified_combining_class (hb_codepoint_t u)
   {


More information about the HarfBuzz mailing list