diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 4ad4faae6..3f4737b32 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -523,9 +523,16 @@ struct skipping_iterator_t #endif void reset (unsigned int start_index_) { + // For GSUB forward iterator idx = start_index_; end = c->buffer->len; - matcher.syllable = start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0; + matcher.syllable = c->buffer->cur().syllable(); + } + void reset_back (unsigned int start_index_, bool from_out_buffer = false) + { + // For GSUB backward iterator + idx = start_index_; + matcher.syllable = c->buffer->cur().syllable(); } #ifndef HB_OPTIMIZE_SIZE @@ -1554,7 +1561,7 @@ static bool match_backtrack (hb_ot_apply_context_t *c, TRACE_APPLY (nullptr); auto &skippy_iter = c->iter_context; - skippy_iter.reset (c->buffer->backtrack_len ()); + skippy_iter.reset_back (c->buffer->backtrack_len ()); skippy_iter.set_match_func (match_func, match_data); skippy_iter.set_glyph_data (backtrack); diff --git a/test/shape/data/in-house/fonts/49bd922bd447fb15bb05abab5c7ceac8d547a3a2.ttf b/test/shape/data/in-house/fonts/49bd922bd447fb15bb05abab5c7ceac8d547a3a2.ttf new file mode 100644 index 000000000..7534faa4b Binary files /dev/null and b/test/shape/data/in-house/fonts/49bd922bd447fb15bb05abab5c7ceac8d547a3a2.ttf differ diff --git a/test/shape/data/in-house/fonts/c2d320136762887c43d245ecd2ffc2c0d57cfcb3.ttf b/test/shape/data/in-house/fonts/c2d320136762887c43d245ecd2ffc2c0d57cfcb3.ttf new file mode 100644 index 000000000..a50b3eb94 Binary files /dev/null and b/test/shape/data/in-house/fonts/c2d320136762887c43d245ecd2ffc2c0d57cfcb3.ttf differ diff --git a/test/shape/data/in-house/tests/cluster.tests b/test/shape/data/in-house/tests/cluster.tests index 544a561be..2c8669bee 100644 --- a/test/shape/data/in-house/tests/cluster.tests +++ b/test/shape/data/in-house/tests/cluster.tests @@ -4,3 +4,4 @@ ../fonts/43ef465752be9af900745f72fe29cb853a1401a5.ttf;--cluster-level=1;U+05D4,U+05B7,U+05E9,U+05BC,U+05C1,U+05B8,U+05DE,U+05B4,U+05DD;[uni05DD=8+1359|uni05B4=7@111,0+0|uni05DE=6+1391|uni05B8=5+0|uni05BC=3+0|uni05C1=3+0|uni05E9=2+1451|uni05B7=1@28,0+0|uni05D4=0+1338] ../fonts/6f36d056bad6d478fc0bf7397bd52dc3bd197d5f.ttf;--cluster-level=1;U+099B,U+09CB,U+09C8,U+09C2,U+09CB,U+098C;[evowelsigninibeng=0+346|aivowelsignbeng=0+346|evowelsignbeng=0+346|chabeng=0+687|uuvowelsignlongbeng=0@-96,0+0|aavowelsignbeng=0+266|aavowelsignbeng=4+266|lvocalicbeng=5+639] ../fonts/fd07ea46e4d8368ada1776208c07fd596f727852.ttf;--cluster-level=1;U+0D4E,U+0D4D,U+200D;[uni0D4E=0+0|uni25CC=0+418|uni0D4D=0+0|space=0+0] +../fonts/c2d320136762887c43d245ecd2ffc2c0d57cfcb3.ttf;;U+0DAF,U+0DCF,U+0DAF;[dasinh=0+547|aavowelsignsinh=0+379|dasinh=2+532] diff --git a/test/shape/data/in-house/tests/context-matching.tests b/test/shape/data/in-house/tests/context-matching.tests index 9f85a0693..4511c7409 100644 --- a/test/shape/data/in-house/tests/context-matching.tests +++ b/test/shape/data/in-house/tests/context-matching.tests @@ -4,3 +4,4 @@ ../fonts/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf;;U+1F1FA,U+1F1FC;[gid3=0+2550] ../fonts/a59fd13f1525a91cbe529c882e93d9d1fbb80463.ttf;--font-funcs=ot;U+0041,U+0042;[gid4=0+1366|gid4=0+1366|gid4=0+1366|gid4=0+1366|gid5=1+1366] ../fonts/bef923f4ccb474f961c43b63a9c74b7d9b7a023f.ttf;;U+0061,U+002E,U+002E,U+002E;[a=0+600|SPC=1+600|SPC=2+600|period_period_period.liga=3+600] +../fonts/49bd922bd447fb15bb05abab5c7ceac8d547a3a2.ttf;;U+0995,U+09BE,U+09B9,U+09BF,U+09A8,U+09C0;[uni0995=0+807|uni09BE=0+266|uni09BF.short01=2+266|uni09B9=2+534|uni09A8=4+602|uni09C0=4+266]