[ot] Preserve pair-positioning and ligature concat hazards

A zero-valued PairPos record can select a different, non-zero record
if the second glyph changes, so keep the pair unsafe to concat even
when no positioning was applied.

Likewise, make the ligature second-glyph digest rejection report the
same hazard as the full ligature walk.

Tests: meson test -C build

Port of https://github.com/harfbuzz/harfrust/pull/465

Assisted-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Behdad Esfahbod committed 2026-09-04 19:55:47 -06:00
1 parent 2a6c6b9b90
commit 92e67ef19f
5 files changed
+9

No files matched your search

+3
View File
@@ -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)
{
+3
View File
@@ -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++)
{
@@ -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]
@@ -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]