From 6fe0d7d6e8be657a64eaf288fc4049e010669c89 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 28 Jul 2021 12:06:49 -0600 Subject: [PATCH] [GSUB] If MultipleSubst is applied to a ligature-component, preserve lig-id Fixes https://github.com/harfbuzz/harfbuzz/issues/3069 --- src/hb-ot-layout-gsub-table.hh | 9 +++++++-- .../b31e6c52a31edadc16f1bec9efe6019e2d59824a.ttf | Bin 0 -> 6812 bytes .../data/in-house/tests/ligature-id.tests | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/shaping/data/in-house/fonts/b31e6c52a31edadc16f1bec9efe6019e2d59824a.ttf diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 9d10c7804..3b84fc31b 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -343,9 +343,14 @@ struct Sequence unsigned int klass = _hb_glyph_info_is_ligature (&c->buffer->cur()) ? HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH : 0; + unsigned lig_id = _hb_glyph_info_get_lig_id (&c->buffer->cur()); - for (unsigned int i = 0; i < count; i++) { - _hb_glyph_info_set_lig_props_for_component (&c->buffer->cur(), i); + for (unsigned int i = 0; i < count; i++) + { + /* If is attached to a ligature, don't disturb that. + * https://github.com/harfbuzz/harfbuzz/issues/3069 */ + if (!lig_id) + _hb_glyph_info_set_lig_props_for_component (&c->buffer->cur(), i); c->output_glyph_for_component (substitute.arrayZ[i], klass); } c->buffer->skip_glyph (); diff --git a/test/shaping/data/in-house/fonts/b31e6c52a31edadc16f1bec9efe6019e2d59824a.ttf b/test/shaping/data/in-house/fonts/b31e6c52a31edadc16f1bec9efe6019e2d59824a.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3a17b92738785d1cf33ad4ef0cbef0bfd232c4ef GIT binary patch literal 6812 zcmaJ_3tUvy*5CV_GiQcjW_S&wFgPL)LGi(JP(U8aLlNbrSlO-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