diff --git a/src/OT/Layout/GPOS/PairSet.hh b/src/OT/Layout/GPOS/PairSet.hh index af91637cc..b1936ed4d 100644 --- a/src/OT/Layout/GPOS/PairSet.hh +++ b/src/OT/Layout/GPOS/PairSet.hh @@ -152,6 +152,9 @@ struct PairSet : ValueBase if (applied_first || applied_second) buffer->unsafe_to_break (buffer->idx, pos + 1); + else + /* Even a zero-valued pair record is a concat hazard. */ + buffer->unsafe_to_concat (buffer->idx, pos + 1); if (len2) { diff --git a/src/OT/Layout/GSUB/LigatureSet.hh b/src/OT/Layout/GSUB/LigatureSet.hh index cefae5d40..143b9a579 100644 --- a/src/OT/Layout/GSUB/LigatureSet.hh +++ b/src/OT/Layout/GSUB/LigatureSet.hh @@ -136,7 +136,10 @@ struct LigatureSet goto slow; if (seconds && !seconds->may_have (second)) + { + c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to); return_trace (false); + } bool unsafe_to_concat = false; for (unsigned int i = 0; i < num_ligs; i++) { diff --git a/test/shape/data/aots/tests/gsub4_1_multiple_ligatures.tests b/test/shape/data/aots/tests/gsub4_1_multiple_ligatures.tests index 447db5f71..6d124cf41 100644 --- a/test/shape/data/aots/tests/gsub4_1_multiple_ligatures.tests +++ b/test/shape/data/aots/tests/gsub4_1_multiple_ligatures.tests @@ -1,3 +1,5 @@ @shaper=ot ../fonts/gsub4_1_multiple_ligatures_f1.otf;--features="test" --single-par --no-clusters --no-glyph-names --no-positions;U+0011,U+0012,U+0013,U+0014,U+0011,U+0012,U+0013,U+0016,U+0014;[17|23|17|24|22|20] ../fonts/gsub4_1_multiple_ligatures_f2.otf;--features="test" --single-par --no-clusters --no-glyph-names --no-positions;U+0011,U+0012,U+0013,U+0014,U+0011,U+0012,U+0013,U+0016,U+0014;[17|24|20|17|24|22|20] +../fonts/gsub4_1_multiple_ligatures_f1.otf;--features="test" --no-clusters --no-glyph-names --no-positions --show-flags --unsafe-to-concat;U+0012,U+0015;[18#2|21#2] +../fonts/gsub4_1_multiple_ligatures_f2.otf;--features="test" --no-clusters --no-glyph-names --no-positions --show-flags --unsafe-to-concat;U+0012,U+0015;[18#2|21#2] diff --git a/test/shape/data/in-house/fonts/3113f846b81ea15c02e05a1c14fa65f9fd342143.otf b/test/shape/data/in-house/fonts/3113f846b81ea15c02e05a1c14fa65f9fd342143.otf new file mode 100644 index 000000000..0f42c843a Binary files /dev/null and b/test/shape/data/in-house/fonts/3113f846b81ea15c02e05a1c14fa65f9fd342143.otf differ diff --git a/test/shape/data/in-house/tests/unsafe-to-concat.tests b/test/shape/data/in-house/tests/unsafe-to-concat.tests index 64381a3a5..226c994cd 100644 --- a/test/shape/data/in-house/tests/unsafe-to-concat.tests +++ b/test/shape/data/in-house/tests/unsafe-to-concat.tests @@ -1 +1,2 @@ ../fonts/34da9aab7bee86c4dfc3b85e423435822fdf4b62.ttf;--show-flags --unsafe-to-concat;U+0628,U+200C,U+0628;[uni0628=1+993#2|uni0628=0+993#2] +../fonts/3113f846b81ea15c02e05a1c14fa65f9fd342143.otf;--features=test --no-glyph-names --no-positions --no-clusters --show-flags --unsafe-to-concat;U+0042,U+0041,U+0058,U+0042;[66|65#2|88#2|66]