From 54e9ab4a91a762dc8a730e22a5b103b206b05db7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 18 Jul 2022 18:57:14 -0600 Subject: [PATCH] [GPOS/Cursive] Fix breaking of parent-child attachment Mostly fixes https://github.com/harfbuzz/harfbuzz/issues/2469 --- src/OT/Layout/GPOS/CursivePosFormat1.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OT/Layout/GPOS/CursivePosFormat1.hh b/src/OT/Layout/GPOS/CursivePosFormat1.hh index e212fab97..ca8e509e4 100644 --- a/src/OT/Layout/GPOS/CursivePosFormat1.hh +++ b/src/OT/Layout/GPOS/CursivePosFormat1.hh @@ -223,7 +223,13 @@ struct CursivePosFormat1 * https://github.com/harfbuzz/harfbuzz/issues/2469 */ if (unlikely (pos[parent].attach_chain() == -pos[child].attach_chain())) + { 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++; return_trace (true);