[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Sun Oct 15 08:49:35 UTC 2017


 src/hb-ot-layout-private.hh                                             |   19 +++++-----
 test/shaping/fonts/sha1sum/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf |binary
 test/shaping/tests/default-ignorables.tests                             |    1 
 3 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 81e2b9b8a959cb7d7503f58fca70761238697fc1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Oct 15 10:48:19 2017 +0200

    Never skip over CGJ
    
    We might want to tweak this some more.  For now, never skipping over
    it is better behavior than always skipping.
    
    Part of https://github.com/behdad/harfbuzz/issues/554

diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh
index 6717adeb..eb8cc308 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout-private.hh
@@ -226,7 +226,9 @@ _next_syllable (hb_buffer_t *buffer, unsigned int start)
  * - General_Category: 5 bits.
  * - A bit each for:
  *   * Is it Default_Ignorable(); we have a modified Default_Ignorable().
- *   * Whether it's one of the three Mongolian Free Variation Selectors.
+ *   * Whether it's one of the three Mongolian Free Variation Selectors,
+ *     CGJ, or other characters that are hidden but should not be ignored
+ *     like most other Default_Ignorable()s do during matching.
  *   * One free bit right now.
  *
  * The high-byte has different meanings, switched by the Gen-Cat:
@@ -264,20 +266,21 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
       buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
       props |=  UPROPS_MASK_IGNORABLE;
       if (u == 0x200Cu) props |= UPROPS_MASK_Cf_ZWNJ;
-      if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
+      else if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
       /* Mongolian Free Variation Selectors need to be remembered
        * because although we need to hide them like default-ignorables,
        * they need to non-ignorable during shaping.  This is similar to
        * what we do for joiners in Indic-like shapers, but since the
        * FVSes are GC=Mn, we have use a separate bit to remember them.
        * Fixes:
-       * https://github.com/behdad/harfbuzz/issues/234
-       */
-      if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_HIDDEN;
+       * https://github.com/behdad/harfbuzz/issues/234 */
+      else 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;
+       * https://github.com/behdad/harfbuzz/issues/463 */
+      else if (unlikely (hb_in_range (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
+      /* COMBINING GRAPHEME JOINER should not be skipped; at least some times.
+       * https://github.com/behdad/harfbuzz/issues/554 */
+      else if (unlikely (u == 0x034Fu)) props |= UPROPS_MASK_HIDDEN;
     }
     else if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL (gen_cat)))
     {
diff --git a/test/shaping/fonts/sha1sum/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf b/test/shaping/fonts/sha1sum/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf
new file mode 100644
index 00000000..4cf9a322
Binary files /dev/null and b/test/shaping/fonts/sha1sum/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf differ
diff --git a/test/shaping/tests/default-ignorables.tests b/test/shaping/tests/default-ignorables.tests
index 2d3ce975..66ee7611 100644
--- a/test/shaping/tests/default-ignorables.tests
+++ b/test/shaping/tests/default-ignorables.tests
@@ -1 +1,2 @@
 fonts/sha1sum/051d92f8bc6ff724511b296c27623f824de256e9.ttf::U+0075,U+0361,U+034F,U+0301,U+0069:[gid2=0+1266|gid7=0 at -617,442+0|gid5=0 at -7,0+0|gid1=4+528]
+fonts/sha1sum/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf::U+0020,U+06CC,U+064E,U+034F,U+0651:[uni0651=1+0|space=1+0|uni064E=1 at 236,-432+0|uni06CC=1+1266|space=0+452]


More information about the HarfBuzz mailing list