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

Previously it was confusing as random incorrect flags were produced.
This commit is contained in:
Behdad Esfahbod 2022-07-30 14:33:33 -06:00
parent 0a31cfb225
commit a722b3e666
1 changed files with 7 additions and 3 deletions

View File

@ -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;
} }
} }