From a722b3e6662d8ffdb529cd4b552ff8770b1523a5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 30 Jul 2022 14:33:33 -0600 Subject: [PATCH] [shape] Only add any unsafe-to-concat flag if requested Previously it was confusing as random incorrect flags were produced. --- src/hb-ot-shape.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 3da317a5c..7f679cfd3 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -1151,6 +1151,8 @@ hb_propagate_flags (hb_buffer_t *buffer) */ bool flip_tatweel = buffer->flags & HB_BUFFER_FLAG_PRODUCE_SAFE_TO_INSERT_TATWEEL; + bool clear_concat = (buffer->flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT) == 0; + hb_glyph_info_t *info = buffer->info; foreach_cluster (buffer, start, end) @@ -1167,9 +1169,11 @@ hb_propagate_flags (hb_buffer_t *buffer) mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT; } - if (mask) - for (unsigned int i = start; i < end; i++) - info[i].mask = mask; + if (clear_concat) + mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_CONCAT; + + for (unsigned int i = start; i < end; i++) + info[i].mask = mask; } }