[PairPos] Another attempt at fixing unsafe-to-break with ValueFormat2

Fixes https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116

Test:
$ hb-shape XBRoya34.ttf  ' الأ' --show-flags --script=arab
This commit is contained in:
Behdad Esfahbod 2022-11-24 12:13:31 -07:00
parent 54ae3345b2
commit 05aa084e67
2 changed files with 8 additions and 6 deletions

View File

@ -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);
}

View File

@ -133,7 +133,8 @@ struct PairSet
{
pos++;
// https://github.com/harfbuzz/harfbuzz/issues/3824
buffer->unsafe_to_break (pos - 1, pos + 1);
// https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116
buffer->unsafe_to_break (buffer->idx, pos + 1);
}
buffer->idx = pos;