diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-08-10 19:50:16 -0700 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-08-10 19:50:16 -0700 |
commit | f0cb1dde12ab12411da2feb54025cf1fab306a68 (patch) | |
tree | 95ba754c993fe29cdfa2a7cc6c0d0fc11bc5ba13 /pango/pango-emoji-table.h | |
parent | 49b9a1bf3ad4e5c8cf2b77fdb6bc4125784a30de (diff) | |
download | pango-f0cb1dde12ab12411da2feb54025cf1fab306a68.tar.gz |
Simplify hb_buffer_set_flags()
From a 2014 HarfBuzz commit:
commit 763e5466c0a03a7c27020e1e2598e488612529a7
Author: Behdad Esfahbod <behdad@behdad.org>
Date: Sat Aug 2 16:17:44 2014 -0400
Make it easier to use HB_BUFFER_FLAG_BOT/EOT
Previously, we expected users to provide BOT/EOT flags when the
text *segment* was at paragraph boundaries. This meant that for
clients that provide full paragraph to HarfBuzz (eg. Pango), they
had code like this:
hb_buffer_set_flags (hb_buffer,
(item_offset == 0 ? HB_BUFFER_FLAG_BOT : 0) |
(item_offset + item_length == paragraph_length ?
HB_BUFFER_FLAG_EOT : 0));
hb_buffer_add_utf8 (hb_buffer,
paragraph_text, paragraph_length,
item_offset, item_length);
After this change such clients can simply say:
hb_buffer_set_flags (hb_buffer,
HB_BUFFER_FLAG_BOT | HB_BUFFER_FLAG_EOT);
hb_buffer_add_utf8 (hb_buffer,
paragraph_text, paragraph_length,
item_offset, item_length);
Ie, HarfBuzz itself checks whether the segment is at the beginning/end
of the paragraph. Clients that only pass item-at-a-time to HarfBuzz
continue not setting any flags whatsoever.
Another way to put it is: if there's pre-context text in the buffer,
HarfBuzz ignores the BOT flag. If there's post-context, it ignores
EOT flag.
Diffstat (limited to 'pango/pango-emoji-table.h')
0 files changed, 0 insertions, 0 deletions