From 72071a8afaba2952fe42be093024ae9dbd37f233 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 May 2010 13:22:24 -0400 Subject: [PATCH] Add a few more buffer convenience methods --- src/hb-buffer-private.hh | 12 ++++++++++++ src/hb-ot-layout-gsub-private.hh | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index 73bae80..db67f81 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -130,6 +130,18 @@ 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, + unsigned short component, + unsigned short ligID) + { _hb_buffer_add_output_glyphs (this, num_in, num_out, glyph_data, component, ligID); } + inline void add_output_glyphs_be16 (unsigned int num_in, + unsigned int num_out, + const uint16_t *glyph_data_be, + unsigned short component, + unsigned short ligID) + { _hb_buffer_add_output_glyphs_be16 (this, num_in, num_out, glyph_data_be, component, ligID); } inline void add_output_glyph (hb_codepoint_t glyph_index, unsigned short component = 0xFFFF, unsigned short ligID = 0xFFFF) diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 9a4b2e8..2b5919e 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -166,9 +166,9 @@ struct Sequence if (unlikely (!substitute.len)) return false; - _hb_buffer_add_output_glyphs_be16 (context->buffer, 1, - substitute.len, (const uint16_t *) substitute.array, - 0xFFFF, 0xFFFF); + context->buffer->add_output_glyphs_be16 (1, + substitute.len, (const uint16_t *) substitute.array, + 0xFFFF, 0xFFFF); /* This is a guess only ... */ if (_hb_ot_layout_has_new_glyph_classes (context->layout->face)) @@ -400,15 +400,15 @@ struct Ligature if (j == context->buffer->in_pos + i) /* No input glyphs skipped */ /* We don't use a new ligature ID if there are no skipped glyphs and the ligature already has an ID. */ - _hb_buffer_add_output_glyphs_be16 (context->buffer, i, - 1, (const uint16_t *) &ligGlyph, - 0, - IN_LIGID (context->buffer->in_pos) && !IN_COMPONENT (context->buffer->in_pos) ? - 0xFFFF : context->buffer->allocate_lig_id ()); + context->buffer->add_output_glyphs_be16 (i, + 1, (const uint16_t *) &ligGlyph, + 0, + IN_LIGID (context->buffer->in_pos) && !IN_COMPONENT (context->buffer->in_pos) ? + 0xFFFF : context->buffer->allocate_lig_id ()); else { unsigned int lig_id = context->buffer->allocate_lig_id (); - _hb_buffer_add_output_glyph (context->buffer, ligGlyph, 0xFFFF, lig_id); + context->buffer->add_output_glyph (ligGlyph, 0xFFFF, lig_id); /* Now we must do a second loop to copy the skipped glyphs to `out' and assign component values to it. We start with the @@ -420,7 +420,7 @@ struct Ligature for ( i = 1; i < count; i++ ) { while (_hb_ot_layout_skip_mark (context->layout->face, IN_CURINFO (), context->lookup_flag, NULL)) - _hb_buffer_add_output_glyph (context->buffer, IN_CURGLYPH (), i, lig_id); + context->buffer->add_output_glyph (IN_CURGLYPH (), i, lig_id); (context->buffer->in_pos)++; } -- 2.7.4