diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index b539f2656..4077bb391 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -112,7 +112,7 @@ struct _hb_buffer_t { HB_INTERNAL void clear_positions (void); HB_INTERNAL void replace_glyphs_be16 (unsigned int num_in, unsigned int num_out, - const uint16_t *glyph_data_be); + const char *glyph_data_be); HB_INTERNAL void replace_glyphs (unsigned int num_in, unsigned int num_out, const hb_codepoint_t *glyph_data); diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index e2c34f14c..9c9b32e3a 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -233,7 +233,7 @@ hb_buffer_t::swap_buffers (void) void hb_buffer_t::replace_glyphs_be16 (unsigned int num_in, unsigned int num_out, - const uint16_t *glyph_data_be) + const char *glyph_data_be) { if (!make_room_for (num_in, num_out)) return; @@ -245,10 +245,11 @@ hb_buffer_t::replace_glyphs_be16 (unsigned int num_in, } hb_glyph_info_t *pinfo = &out_info[out_len]; + const unsigned char *data = (const unsigned char *) glyph_data_be; for (unsigned int i = 0; i < num_out; i++) { *pinfo = orig_info; - pinfo->codepoint = hb_be_uint16 (glyph_data_be[i]); + pinfo->codepoint = (data[2*i] << 8) | data[2*i+1]; pinfo++; } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index f6a757530..4229f32f0 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -213,7 +213,7 @@ struct Sequence if (unlikely (!substitute.len)) return TRACE_RETURN (false); unsigned int klass = c->property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE ? HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH : 0; - c->replace_glyphs_be16 (1, substitute.len, (const uint16_t *) substitute.array, klass); + c->replace_glyphs_be16 (1, substitute.len, (const char *) substitute.array, klass); return TRACE_RETURN (true); } @@ -502,7 +502,7 @@ struct Ligature if (skippy_iter.idx < c->buffer->idx + count) /* No input glyphs skipped */ { - c->replace_glyphs_be16 (count, 1, (const uint16_t *) &ligGlyph, klass); + c->replace_glyphs_be16 (count, 1, (const char *) &ligGlyph, klass); } else { diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index a2e4b2fdb..e590e3955 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -230,7 +230,7 @@ struct hb_apply_context_t } inline void replace_glyphs_be16 (unsigned int num_in, unsigned int num_out, - const uint16_t *glyph_data_be, + const char *glyph_data_be, unsigned int klass = 0) const { buffer->cur().props_cache() = klass; /* XXX if has gdef? */