diff options
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-buffer.hh')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-buffer.hh | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/thirdparty/harfbuzz/src/hb-buffer.hh b/thirdparty/harfbuzz/src/hb-buffer.hh index adf4aa2b6f..bc6992905e 100644 --- a/thirdparty/harfbuzz/src/hb-buffer.hh +++ b/thirdparty/harfbuzz/src/hb-buffer.hh @@ -212,6 +212,20 @@ struct hb_buffer_t HB_INTERNAL void enter (); HB_INTERNAL void leave (); +#ifndef HB_NO_BUFFER_VERIFY + HB_INTERNAL +#endif + bool verify (hb_buffer_t *text_buffer, + hb_font_t *font, + const hb_feature_t *features, + unsigned int num_features, + const char * const *shapers) +#ifndef HB_NO_BUFFER_VERIFY + ; +#else + { return true; } +#endif + unsigned int backtrack_len () const { return have_output ? out_len : idx; } unsigned int lookahead_len () const { return len - idx; } uint8_t next_serial () { return ++serial ? serial : ++serial; } @@ -386,11 +400,14 @@ struct hb_buffer_t HB_INTERNAL void delete_glyph (); - void set_glyph_flags (hb_mask_t mask, - unsigned start = 0, - unsigned end = (unsigned) -1, - bool interior = false, - bool from_out_buffer = false) + /* Adds glyph flags in mask to infos with clusters between start and end. + * The start index will be from out-buffer if from_out_buffer is true. + * If interior is true, then the cluster having the minimum value is skipped. */ + void _set_glyph_flags (hb_mask_t mask, + unsigned start = 0, + unsigned end = (unsigned) -1, + bool interior = false, + bool from_out_buffer = false) { end = hb_min (end, len); @@ -437,27 +454,31 @@ struct hb_buffer_t void unsafe_to_break (unsigned int start = 0, unsigned int end = -1) { - set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, - start, end, - true); + _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 = 0, unsigned int end = -1) { - set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, - start, end, - true); + if (likely ((flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT) == 0)) + return; + _set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, + true); } void unsafe_to_break_from_outbuffer (unsigned int start = 0, unsigned int end = -1) { - set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_BREAK | HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, - start, end, - true, true); + _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 = 0, unsigned int end = -1) { - set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, - start, end, - false, true); + if (likely ((flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT) == 0)) + return; + _set_glyph_flags (HB_GLYPH_FLAG_UNSAFE_TO_CONCAT, + start, end, + false, true); } |