src/hb-aat-layout-morx-table.hh                          |    7 ++++---
 test/shaping/data/in-house/Makefile.sources              |    1 +
 test/shaping/data/in-house/fonts/TestMORXTwentyeight.ttf |binary
 test/shaping/data/in-house/tests/aat-morx.tests          |    1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit ba502dea1e81981f3893b5353400909bf60e354f
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Tue Oct 23 16:46:10 2018 -0700

    [morx] Fix cluster-merging when ligating
    
    Only merge when actual ligature happened.
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/1305

diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index ff791cb7..c663fcc8 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -399,9 +399,6 @@ struct LigatureSubtable
        if (unlikely (!match_length))
          return true;
 
-       /* TODO Only when ligation happens? */
-       buffer->merge_out_clusters (match_positions[0], buffer->out_len);
-
        unsigned int cursor = match_length;
         do
        {
@@ -437,6 +434,7 @@ struct LigatureSubtable
                     bool (action & LigActionLast));
          if (action & (LigActionStore | LigActionLast))
          {
+
            const GlyphID &ligatureData = ligature[ligature_idx];
            if (unlikely (!ligatureData.sanitize (&c->sanitizer))) return false;
            hb_codepoint_t lig = ligatureData;
@@ -452,6 +450,9 @@ struct LigatureSubtable
              buffer->skip_glyph ();
              end--;
            }
+
+           buffer->move_to (end + 1);
+           buffer->merge_out_clusters (match_positions[cursor], 
buffer->out_len);
          }
 
          action_idx++;
diff --git a/test/shaping/data/in-house/Makefile.sources 
b/test/shaping/data/in-house/Makefile.sources
index 6e21ddd4..e5f105c7 100644
--- a/test/shaping/data/in-house/Makefile.sources
+++ b/test/shaping/data/in-house/Makefile.sources
@@ -1,5 +1,6 @@
 TESTS = \
        tests/aat-trak.tests \
+       tests/aat-morx.tests \
        tests/arabic-fallback-shaping.tests \
        tests/arabic-feature-order.tests \
        tests/arabic-like-joining.tests \
diff --git a/test/shaping/data/in-house/fonts/TestMORXTwentyeight.ttf 
b/test/shaping/data/in-house/fonts/TestMORXTwentyeight.ttf
new file mode 100644
index 00000000..edabb439
Binary files /dev/null and 
b/test/shaping/data/in-house/fonts/TestMORXTwentyeight.ttf differ
diff --git a/test/shaping/data/in-house/tests/aat-morx.tests 
b/test/shaping/data/in-house/tests/aat-morx.tests
new file mode 100644
index 00000000..4153091d
--- /dev/null
+++ b/test/shaping/data/in-house/tests/aat-morx.tests
@@ -0,0 +1 @@
+../fonts/TestMORXTwentyeight.ttf::U+0041,U+0078,U+0045,U+0079,U+0044,U+0079,U+0079:[A_E_D=0+1394|x=0+529|y=0+510|y=5+510|y=6+510]
_______________________________________________
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to