[GPOS/Cursive] Fix breaking of parent-child attachment

Mostly fixes https://github.com/harfbuzz/harfbuzz/issues/2469
This commit is contained in:
Behdad Esfahbod 2022-07-18 18:57:14 -06:00
parent c2baf2796c
commit 54e9ab4a91
1 changed files with 6 additions and 0 deletions

View File

@ -223,7 +223,13 @@ struct CursivePosFormat1
* https://github.com/harfbuzz/harfbuzz/issues/2469 * https://github.com/harfbuzz/harfbuzz/issues/2469
*/ */
if (unlikely (pos[parent].attach_chain() == -pos[child].attach_chain())) if (unlikely (pos[parent].attach_chain() == -pos[child].attach_chain()))
{
pos[parent].attach_chain() = 0; pos[parent].attach_chain() = 0;
if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
pos[parent].y_offset = 0;
else
pos[parent].x_offset = 0;
}
buffer->idx++; buffer->idx++;
return_trace (true); return_trace (true);