[shape] Only add any unsafe-to-concat flag if requested

Previously it was confusing as random incorrect flags were produced.
pull/3771/head
Behdad Esfahbod 2 years ago
parent 0a31cfb225
commit a722b3e666
  1. 10
      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 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; hb_glyph_info_t *info = buffer->info;
foreach_cluster (buffer, start, end) 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; mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT;
} }
if (mask) if (clear_concat)
for (unsigned int i = start; i < end; i++) mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_CONCAT;
info[i].mask = mask;
for (unsigned int i = start; i < end; i++)
info[i].mask = mask;
} }
} }

Loading…
Cancel
Save