src/hb-aat-layout-morx-table.hh                                    |   27 
+++++-----
 test/shaping/data/text-rendering-tests/DISABLED                    |    2 
 test/shaping/data/text-rendering-tests/Makefile.sources            |    1 
 test/shaping/data/text-rendering-tests/fonts/TestMORXFourtyone.ttf |binary
 test/shaping/data/text-rendering-tests/tests/MORX-41.tests         |    4 +
 5 files changed, 22 insertions(+), 12 deletions(-)

New commits:
commit 2137582c9696b6e38d70b4a0d4199b315c9fd4ce
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Tue Oct 16 14:46:07 2018 -0700

    [morx] Reword ligation
    
    Still fails MORX-41.  Am talking to Sascha to better understand what 
CoreText
    is doing.

diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index 925c7da8..d8ba28ba 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -393,16 +393,18 @@ struct LigatureSubtable
        unsigned int ligature_idx = 0;
 
        if (unlikely (!match_length))
-         return false;
+         return true;
 
+       /* TODO Only when ligation happens? */
        buffer->merge_out_clusters (match_positions[0], buffer->out_len);
 
+       unsigned int cursor = match_length;
         do
        {
-         if (unlikely (!match_length))
-           return false;
+         if (unlikely (!cursor))
+           break;
 
-         buffer->move_to (match_positions[--match_length]);
+         buffer->move_to (match_positions[--cursor]);
 
          const HBUINT32 &actionData = ligAction[action_idx];
          if (unlikely (!actionData.sanitize (&c->sanitizer))) return false;
@@ -426,20 +428,21 @@ struct LigatureSubtable
            if (unlikely (!ligatureData.sanitize (&c->sanitizer))) return false;
            hb_codepoint_t lig = ligatureData;
 
-           match_positions[match_length++] = buffer->out_len;
            buffer->replace_glyph (lig);
 
-           //ligature_idx = 0; // XXX Yes or no?
-         }
-         else
-         {
-           buffer->skip_glyph ();
-           end--;
+           /* Now go and delete all subsequent components. */
+           while (match_length - 1 > cursor)
+           {
+             buffer->move_to (match_positions[--match_length]);
+             buffer->skip_glyph ();
+             end--;
+           }
          }
 
          action_idx++;
        }
        while (!(action & LigActionLast));
+       match_length = 0;
        buffer->move_to (end);
       }
 
diff --git a/test/shaping/data/text-rendering-tests/DISABLED 
b/test/shaping/data/text-rendering-tests/DISABLED
index 8539c0ee..ef987a4d 100644
--- a/test/shaping/data/text-rendering-tests/DISABLED
+++ b/test/shaping/data/text-rendering-tests/DISABLED
@@ -1,3 +1,5 @@
+tests/MORX-41.tests
+
 # Non-Unicode cmap
 tests/CMAP-3.tests
 
diff --git a/test/shaping/data/text-rendering-tests/Makefile.sources 
b/test/shaping/data/text-rendering-tests/Makefile.sources
index f3325633..5e0db6bd 100644
--- a/test/shaping/data/text-rendering-tests/Makefile.sources
+++ b/test/shaping/data/text-rendering-tests/Makefile.sources
@@ -62,7 +62,6 @@ TESTS = \
        tests/MORX-39.tests \
        tests/MORX-3.tests \
        tests/MORX-40.tests \
-       tests/MORX-41.tests \
        tests/MORX-4.tests \
        tests/MORX-5.tests \
        tests/MORX-6.tests \
@@ -74,6 +73,7 @@ TESTS = \
        $(NULL)
 
 DISBALED_TESTS = \
+       tests/MORX-41.tests \
        tests/CMAP-3.tests \
        tests/SHARAN-1.tests \
        tests/SHBALI-1.tests \
commit c53a25c6579a4d3fe8e6a6fc198d70add41035ec
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Tue Oct 16 13:57:35 2018 -0700

    [morx] Comment

diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index c88e7a72..925c7da8 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -410,7 +410,7 @@ struct LigatureSubtable
 
          uint32_t uoffset = action & LigActionOffset;
          if (uoffset & 0x20000000)
-           uoffset += 0xC0000000;
+           uoffset |= 0xC0000000; /* Sign-extend. */
          int32_t offset = (int32_t) uoffset;
          if (buffer->idx >= buffer->len)
            return false; // TODO Work on previous instead?
commit c46d42f8f2c303817467c6a4e19d69d0e433dba6
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Tue Oct 16 13:39:54 2018 -0700

    [test/text-rendering-tests] Update from upstream

diff --git a/test/shaping/data/text-rendering-tests/Makefile.sources 
b/test/shaping/data/text-rendering-tests/Makefile.sources
index c7f48760..f3325633 100644
--- a/test/shaping/data/text-rendering-tests/Makefile.sources
+++ b/test/shaping/data/text-rendering-tests/Makefile.sources
@@ -62,6 +62,7 @@ TESTS = \
        tests/MORX-39.tests \
        tests/MORX-3.tests \
        tests/MORX-40.tests \
+       tests/MORX-41.tests \
        tests/MORX-4.tests \
        tests/MORX-5.tests \
        tests/MORX-6.tests \
diff --git a/test/shaping/data/text-rendering-tests/fonts/TestMORXFourtyone.ttf 
b/test/shaping/data/text-rendering-tests/fonts/TestMORXFourtyone.ttf
new file mode 100644
index 00000000..98ebe332
Binary files /dev/null and 
b/test/shaping/data/text-rendering-tests/fonts/TestMORXFourtyone.ttf differ
diff --git a/test/shaping/data/text-rendering-tests/tests/MORX-41.tests 
b/test/shaping/data/text-rendering-tests/tests/MORX-41.tests
new file mode 100644
index 00000000..84dca89a
--- /dev/null
+++ b/test/shaping/data/text-rendering-tests/tests/MORX-41.tests
@@ -0,0 +1,4 @@
+../fonts/TestMORXFourtyone.ttf:--font-size=1000 --ned 
--remove-default-ignorables --font-funcs=ft:U+0061,U+0063:[a_c]
+../fonts/TestMORXFourtyone.ttf:--font-size=1000 --ned 
--remove-default-ignorables --font-funcs=ft:U+0062,U+0063:[b_c]
+../fonts/TestMORXFourtyone.ttf:--font-size=1000 --ned 
--remove-default-ignorables --font-funcs=ft:U+0063,U+0063:[c]
+../fonts/TestMORXFourtyone.ttf:--font-size=1000 --ned 
--remove-default-ignorables 
--font-funcs=ft:U+0061,U+0062,U+0063,U+0063:[a|b_c@561,0|c@1631,0]
_______________________________________________
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to