diff --git a/src/OT/Layout/GPOS/PairPosFormat2.hh b/src/OT/Layout/GPOS/PairPosFormat2.hh index 1bb0d60ae..523e0e936 100644 --- a/src/OT/Layout/GPOS/PairPosFormat2.hh +++ b/src/OT/Layout/GPOS/PairPosFormat2.hh @@ -241,15 +241,16 @@ struct PairPosFormat2_4 boring: buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); - - buffer->idx = skippy_iter.idx; if (len2) { - buffer->idx++; + skippy_iter.idx++; // https://github.com/harfbuzz/harfbuzz/issues/3824 - buffer->unsafe_to_break (buffer->idx - 1, buffer->idx + 1); + // https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116 + buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1); } + buffer->idx = skippy_iter.idx; + return_trace (true); } diff --git a/src/OT/Layout/GPOS/PairSet.hh b/src/OT/Layout/GPOS/PairSet.hh index b1d9f83bc..2ad1f004c 100644 --- a/src/OT/Layout/GPOS/PairSet.hh +++ b/src/OT/Layout/GPOS/PairSet.hh @@ -132,8 +132,9 @@ struct PairSet if (len2) { pos++; - // https://github.com/harfbuzz/harfbuzz/issues/3824 - buffer->unsafe_to_break (pos - 1, pos + 1); + // https://github.com/harfbuzz/harfbuzz/issues/3824 + // https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116 + buffer->unsafe_to_break (buffer->idx, pos + 1); } buffer->idx = pos;