diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 0354b47d5..346024f2b 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -406,6 +406,7 @@ struct KerxSubTableFormat2 accelerator_t accel (*this, c); hb_kern_machine_t machine (accel, header.coverage & header.CrossStream); machine.kern (c->font, c->buffer, c->plan->kern_mask); + c->buffer->set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT); return_trace (true); } diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 942da91e1..c0d2e46f1 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -386,12 +386,15 @@ struct hb_buffer_t HB_INTERNAL void delete_glyph (); - void set_glyph_flags (unsigned start, - unsigned end, - hb_mask_t mask, + void set_glyph_flags (hb_mask_t mask, + unsigned start = 0, + unsigned end = (unsigned) -1, bool interior = false, bool from_out_buffer = false) { + if (end == (unsigned) -1) + end = len; + if (interior && !from_out_buffer && end - start < 2) return; @@ -435,22 +438,26 @@ struct hb_buffer_t void unsafe_to_break (unsigned int start, unsigned int end) { - set_glyph_flags (start, end, HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, true); } void unsafe_to_concat (unsigned int start, unsigned int end) { - set_glyph_flags (start, end, HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, true); } void unsafe_to_break_from_outbuffer (unsigned int start, unsigned int end) { - set_glyph_flags (start, end, HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, true, true); } void unsafe_to_concat_from_outbuffer (unsigned int start, unsigned int end) { - set_glyph_flags (start, end, HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, true, true); }