summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hb-buffer-private.hh10
-rw-r--r--src/hb-buffer.cc19
-rw-r--r--src/hb-ot-shape.cc2
3 files changed, 27 insertions, 4 deletions
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index 4fae8845..73535d4b 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -66,6 +66,13 @@ _hb_buffer_replace_glyph (hb_buffer_t *buffer,
hb_codepoint_t glyph_index);
HB_INTERNAL void
+_hb_buffer_output_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index);
+
+HB_INTERNAL void
+_hb_buffer_skip_glyph (hb_buffer_t *buffer);
+
+HB_INTERNAL void
_hb_buffer_next_glyph (hb_buffer_t *buffer);
@@ -125,6 +132,9 @@ struct _hb_buffer_t {
{ _hb_buffer_replace_glyphs_be16 (this, num_in, num_out, glyph_data_be); }
inline void replace_glyph (hb_codepoint_t glyph_index)
{ _hb_buffer_replace_glyph (this, glyph_index); }
+ inline void output_glyph (hb_codepoint_t glyph_index)
+ { _hb_buffer_output_glyph (this, glyph_index); }
+ inline void skip_glyph (void) { _hb_buffer_skip_glyph (this); }
inline void reset_masks (hb_mask_t mask)
{
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index b65ddbb4..174d8e8d 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -404,8 +404,8 @@ _hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer,
}
void
-_hb_buffer_replace_glyph (hb_buffer_t *buffer,
- hb_codepoint_t glyph_index)
+_hb_buffer_output_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index)
{
hb_glyph_info_t *info;
@@ -420,11 +420,24 @@ _hb_buffer_replace_glyph (hb_buffer_t *buffer,
info = &buffer->out_info[buffer->out_len];
info->codepoint = glyph_index;
- buffer->i++;
buffer->out_len++;
}
void
+_hb_buffer_replace_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index)
+{
+ _hb_buffer_output_glyph (buffer, glyph_index);
+ _hb_buffer_skip_glyph (buffer);
+}
+
+void
+_hb_buffer_skip_glyph (hb_buffer_t *buffer)
+{
+ buffer->i++;
+}
+
+void
_hb_buffer_next_glyph (hb_buffer_t *buffer)
{
if (buffer->have_output)
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 306beb3b..33123d40 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -264,7 +264,7 @@ hb_map_glyphs (hb_font_t *font,
if (unlikely (is_variation_selector (buffer->info[buffer->i + 1].codepoint))) {
hb_font_get_glyph (font, buffer->info[buffer->i].codepoint, buffer->info[buffer->i + 1].codepoint, &glyph);
buffer->replace_glyph (glyph);
- buffer->i++;
+ buffer->skip_glyph ();
} else {
hb_font_get_glyph (font, buffer->info[buffer->i].codepoint, 0, &glyph);
buffer->replace_glyph (glyph);