diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 83cd3dca8..d2211d7bf 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -416,12 +416,13 @@ reset: return ret; } -void +int hb_buffer_t::sync_so_far () { bool had_output = have_output; unsigned out_i = out_len; unsigned i = idx; + unsigned old_idx = idx; if (sync ()) idx = out_i; @@ -435,6 +436,8 @@ hb_buffer_t::sync_so_far () } assert (idx <= len); + + return idx - old_idx; } bool diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 1b89a32db..a05f1662e 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -289,7 +289,7 @@ struct hb_buffer_t HB_INTERNAL void guess_segment_properties (); HB_INTERNAL bool sync (); - HB_INTERNAL void sync_so_far (); + HB_INTERNAL int sync_so_far (); HB_INTERNAL void clear_output (); HB_INTERNAL void clear_positions ();