diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index ff791cb7faca2c49b00472aa5a66b512fc122344..c663fcc846ad75fdac5398da20d32f887b18a54b 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 6e21ddd4ce5f177c942e3d5bf7423cc73af8f0bb..e5f105c781b185f18022bc1796493ff02d6668b8 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 0000000000000000000000000000000000000000..edabb439cdc63fa958a8d2dee7ed44fa96ebfc22 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 0000000000000000000000000000000000000000..4153091d0dc932194154b9db3a7b72397c89d66d --- /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]