From 7090707de67e660ae626ecf774f6af8a63a692ab Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 17 Jun 2020 17:41:15 -0700 Subject: [PATCH] [gpos] Break cycle-of-2 when cursive attaching Fixes https://github.com/harfbuzz/harfbuzz/issues/2469 --- src/hb-ot-layout-gpos-table.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 5fd848fe6..b54eb6acd 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1692,6 +1692,12 @@ struct CursivePosFormat1 else pos[child].x_offset = x_offset; + /* If parent was attached to child, break them free. + * https://github.com/harfbuzz/harfbuzz/issues/2469 + */ + if (unlikely (pos[parent].attach_chain() = -pos[child].attach_chain())) + pos[parent].attach_chain() = 0; + buffer->idx++; return_trace (true); }