From dd2ffd282c059194fd87fb1664e2e0cdb56a87a0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Oct 2010 16:57:01 -0400 Subject: [PATCH] Minor renaming --- src/hb-buffer-private.hh | 41 ++++++++++++++++---------------- src/hb-buffer.cc | 20 ++++++++-------- src/hb-ot-layout-gsub-private.hh | 8 +++---- src/hb-ot-shape.cc | 6 ++--- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index 97da61037..2ad821201 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -59,20 +59,20 @@ HB_INTERNAL void _hb_buffer_clear_output (hb_buffer_t *buffer); HB_INTERNAL void -_hb_buffer_add_output_glyphs (hb_buffer_t *buffer, - unsigned int num_in, - unsigned int num_out, - const hb_codepoint_t *glyph_data); +_hb_buffer_replace_glyphs (hb_buffer_t *buffer, + unsigned int num_in, + unsigned int num_out, + const hb_codepoint_t *glyph_data); HB_INTERNAL void -_hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer, - unsigned int num_in, - unsigned int num_out, - const uint16_t *glyph_data_be); +_hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer, + unsigned int num_in, + unsigned int num_out, + const uint16_t *glyph_data_be); HB_INTERNAL void -_hb_buffer_add_output_glyph (hb_buffer_t *buffer, - hb_codepoint_t glyph_index); +_hb_buffer_replace_glyph (hb_buffer_t *buffer, + hb_codepoint_t glyph_index); HB_INTERNAL void _hb_buffer_next_glyph (hb_buffer_t *buffer); @@ -128,17 +128,16 @@ struct _hb_buffer_t { inline void swap (void) { _hb_buffer_swap (this); } inline void clear_output (void) { _hb_buffer_clear_output (this); } inline void next_glyph (void) { _hb_buffer_next_glyph (this); } - inline void add_output_glyphs (unsigned int num_in, - unsigned int num_out, - const hb_codepoint_t *glyph_data) - { _hb_buffer_add_output_glyphs (this, num_in, num_out, glyph_data); } - inline void add_output_glyphs_be16 (unsigned int num_in, - unsigned int num_out, - const uint16_t *glyph_data_be) - { _hb_buffer_add_output_glyphs_be16 (this, num_in, num_out, glyph_data_be); } - inline void add_output_glyph (hb_codepoint_t glyph_index) - { _hb_buffer_add_output_glyph (this, glyph_index); } - inline void replace_glyph (hb_codepoint_t glyph_index) { add_output_glyph (glyph_index); } + inline void replace_glyphs (unsigned int num_in, + unsigned int num_out, + const hb_codepoint_t *glyph_data) + { _hb_buffer_replace_glyphs (this, num_in, num_out, glyph_data); } + inline void replace_glyphs_be16 (unsigned int num_in, + unsigned int num_out, + const uint16_t *glyph_data_be) + { _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 reset_masks (hb_mask_t mask) { diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 7eb037069..7bdee9fdd 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -311,10 +311,10 @@ _hb_buffer_swap (hb_buffer_t *buffer) } void -_hb_buffer_add_output_glyphs (hb_buffer_t *buffer, - unsigned int num_in, - unsigned int num_out, - const hb_codepoint_t *glyph_data) +_hb_buffer_replace_glyphs (hb_buffer_t *buffer, + unsigned int num_in, + unsigned int num_out, + const hb_codepoint_t *glyph_data) { if (buffer->out_info != buffer->info || buffer->out_len + num_out > buffer->i + num_in) @@ -338,10 +338,10 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer, } void -_hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer, - unsigned int num_in, - unsigned int num_out, - const uint16_t *glyph_data_be) +_hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer, + unsigned int num_in, + unsigned int num_out, + const uint16_t *glyph_data_be) { if (buffer->out_info != buffer->info || buffer->out_len + num_out > buffer->i + num_in) @@ -365,8 +365,8 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer, } void -_hb_buffer_add_output_glyph (hb_buffer_t *buffer, - hb_codepoint_t glyph_index) +_hb_buffer_replace_glyph (hb_buffer_t *buffer, + hb_codepoint_t glyph_index) { hb_glyph_info_t *info; diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 829217c9e..7e37d51f8 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -164,7 +164,7 @@ struct Sequence if (unlikely (!substitute.len)) return false; - c->buffer->add_output_glyphs_be16 (1, substitute.len, (const uint16_t *) substitute.array); + c->buffer->replace_glyphs_be16 (1, substitute.len, (const uint16_t *) substitute.array); /* This is a guess only ... */ if (_hb_ot_layout_has_new_glyph_classes (c->layout->face)) @@ -397,11 +397,11 @@ struct Ligature if (j == c->buffer->i + i) /* No input glyphs skipped */ { - c->buffer->add_output_glyphs_be16 (i, 1, (const uint16_t *) &ligGlyph); + c->buffer->replace_glyphs_be16 (i, 1, (const uint16_t *) &ligGlyph); } else { - c->buffer->add_output_glyph (ligGlyph); + c->buffer->replace_glyph (ligGlyph); /* Now we must do a second loop to copy the skipped glyphs to `out' and assign component values to it. We start with the @@ -416,7 +416,7 @@ struct Ligature { c->buffer->info[c->buffer->i].component() = i; c->buffer->info[c->buffer->i].lig_id() = lig_id; - c->buffer->add_output_glyph (c->buffer->info[c->buffer->i].codepoint); + c->buffer->replace_glyph (c->buffer->info[c->buffer->i].codepoint); } /* Skip the base glyph */ diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 5770cbfd9..64a1a3de7 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -198,14 +198,14 @@ hb_map_glyphs (hb_font_t *font, unsigned int count = buffer->len - 1; for (buffer->i = 0; buffer->i < count;) { if (unlikely (is_variation_selector (buffer->info[buffer->i + 1].codepoint))) { - buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, buffer->info[buffer->i + 1].codepoint)); + buffer->replace_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, buffer->info[buffer->i + 1].codepoint)); buffer->i++; } else { - buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0)); + buffer->replace_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0)); } } if (likely (buffer->i < buffer->len)) - buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0)); + buffer->replace_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0)); buffer->swap (); }