_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned int num_in,
unsigned int num_out,
- const uint16_t *glyph_data_be,
+ const hb_codepoint_t *glyph_data,
unsigned short component,
unsigned short ligID);
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,
+ unsigned short component,
+ unsigned short ligID);
+
+HB_INTERNAL void
_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
hb_codepoint_t glyph_index,
unsigned short component,
The cluster value for the glyph at position buffer->in_pos is used
for all replacement glyphs */
+
void
_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned int num_in,
unsigned int num_out,
- const uint16_t *glyph_data_be,
+ const hb_codepoint_t *glyph_data,
unsigned short component,
unsigned short lig_id)
{
for (i = 0; i < num_out; i++)
{
hb_internal_glyph_info_t *info = &buffer->out_string[buffer->out_pos + i];
- info->codepoint = hb_be_uint16 (glyph_data_be[i]);
+ info->codepoint = glyph_data[i];
info->mask = mask;
info->cluster = cluster;
info->component = component;
buffer->out_length = buffer->out_pos;
}
+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,
+ unsigned short component,
+ unsigned short lig_id)
+{
+ unsigned int i;
+ unsigned int mask;
+ unsigned int cluster;
+
+ if (buffer->out_string != buffer->in_string ||
+ buffer->out_pos + num_out > buffer->in_pos + num_in)
+ {
+ hb_buffer_ensure_separate (buffer, buffer->out_pos + num_out);
+ }
+
+ mask = buffer->in_string[buffer->in_pos].mask;
+ cluster = buffer->in_string[buffer->in_pos].cluster;
+ if (component == 0xFFFF)
+ component = buffer->in_string[buffer->in_pos].component;
+ if (lig_id == 0xFFFF)
+ lig_id = buffer->in_string[buffer->in_pos].lig_id;
+
+ for (i = 0; i < num_out; i++)
+ {
+ hb_internal_glyph_info_t *info = &buffer->out_string[buffer->out_pos + i];
+ info->codepoint = hb_be_uint16 (glyph_data_be[i]);
+ info->mask = mask;
+ info->cluster = cluster;
+ info->component = component;
+ info->lig_id = lig_id;
+ info->gproperty = HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN;
+ }
+
+ buffer->in_pos += num_in;
+ buffer->out_pos += num_out;
+ buffer->out_length = buffer->out_pos;
+}
void
_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
if (HB_UNLIKELY (!substitute.len))
return false;
- _hb_buffer_add_output_glyphs (buffer, 1,
- substitute.len, (const uint16_t *) substitute.const_array(),
- 0xFFFF, 0xFFFF);
+ _hb_buffer_add_output_glyphs_be16 (buffer, 1,
+ substitute.len, (const uint16_t *) substitute.const_array(),
+ 0xFFFF, 0xFFFF);
/* This is a guess only ... */
if (_hb_ot_layout_has_new_glyph_classes (context->face))
if (j == 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 (buffer, i,
- 1, (const uint16_t *) &ligGlyph,
- 0xFFFF,
- IN_LIGID (buffer->in_pos) ?
- 0xFFFF : _hb_buffer_allocate_lig_id (buffer));
+ _hb_buffer_add_output_glyphs_be16 (buffer, i,
+ 1, (const uint16_t *) &ligGlyph,
+ 0xFFFF,
+ IN_LIGID (buffer->in_pos) ?
+ 0xFFFF : _hb_buffer_allocate_lig_id (buffer));
else
{
unsigned int lig_id = _hb_buffer_allocate_lig_id (buffer);