_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned int num_in,
unsigned int num_out,
- const hb_codepoint_t *glyph_data,
- unsigned short component,
- unsigned short ligID);
+ 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,
- unsigned short component,
- unsigned short ligID);
+ const uint16_t *glyph_data_be);
HB_INTERNAL void
_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
- hb_codepoint_t glyph_index,
- unsigned short component,
- unsigned short ligID);
+ hb_codepoint_t glyph_index);
HB_INTERNAL void
_hb_buffer_next_glyph (hb_buffer_t *buffer);
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); }
+ 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,
- 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)
- { _hb_buffer_add_output_glyph (this, glyph_index, component, ligID); }
+ 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 reset_masks (hb_mask_t mask)
_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned int num_in,
unsigned int num_out,
- const hb_codepoint_t *glyph_data,
- unsigned short component,
- unsigned short lig_id)
+ const hb_codepoint_t *glyph_data)
{
- unsigned int i;
- unsigned int mask;
- unsigned int cluster;
-
if (buffer->out_info != buffer->info ||
buffer->out_len + num_out > buffer->i + num_in)
{
return;
}
- mask = buffer->info[buffer->i].mask;
- cluster = buffer->info[buffer->i].cluster;
- if (component == 0xFFFF)
- component = buffer->info[buffer->i].component();
- if (lig_id == 0xFFFF)
- lig_id = buffer->info[buffer->i].lig_id();
+ hb_glyph_info_t orig_info = buffer->info[buffer->i];
- for (i = 0; i < num_out; i++)
+ for (unsigned int i = 0; i < num_out; i++)
{
hb_glyph_info_t *info = &buffer->out_info[buffer->out_len + i];
+ *info = orig_info;
info->codepoint = glyph_data[i];
- info->mask = mask;
- info->cluster = cluster;
- info->component() = component;
- info->lig_id() = lig_id;
info->gproperty() = HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN;
}
_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)
+ const uint16_t *glyph_data_be)
{
- unsigned int i;
- unsigned int mask;
- unsigned int cluster;
-
if (buffer->out_info != buffer->info ||
buffer->out_len + num_out > buffer->i + num_in)
{
return;
}
- mask = buffer->info[buffer->i].mask;
- cluster = buffer->info[buffer->i].cluster;
- if (component == 0xFFFF)
- component = buffer->info[buffer->i].component();
- if (lig_id == 0xFFFF)
- lig_id = buffer->info[buffer->i].lig_id();
+ hb_glyph_info_t orig_info = buffer->info[buffer->i];
- for (i = 0; i < num_out; i++)
+ for (unsigned int i = 0; i < num_out; i++)
{
hb_glyph_info_t *info = &buffer->out_info[buffer->out_len + i];
+ *info = orig_info;
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;
}
void
_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
- hb_codepoint_t glyph_index,
- unsigned short component,
- unsigned short lig_id)
+ hb_codepoint_t glyph_index)
{
hb_glyph_info_t *info;
info = &buffer->out_info[buffer->out_len];
info->codepoint = glyph_index;
- if (component != 0xFFFF)
- info->component() = component;
- if (lig_id != 0xFFFF)
- info->lig_id() = lig_id;
info->gproperty() = HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN;
buffer->i++;
if (unlikely (!substitute.len))
return false;
- c->buffer->add_output_glyphs_be16 (1,
- substitute.len, (const uint16_t *) substitute.array,
- 0xFFFF, 0xFFFF);
+ c->buffer->add_output_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))
is_mark ? HB_OT_LAYOUT_GLYPH_CLASS_MARK
: HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE);
+ /* Allocate new ligature id */
+ unsigned int lig_id = c->buffer->allocate_lig_id ();
+ c->buffer->info[c->buffer->i].component() = 0;
+ c->buffer->info[c->buffer->i].lig_id() = lig_id;
+
if (j == c->buffer->i + i) /* No input glyphs skipped */
- c->buffer->add_output_glyphs_be16 (i,
- 1, (const uint16_t *) &ligGlyph,
- 0,
- c->buffer->allocate_lig_id ());
+ {
+ c->buffer->add_output_glyphs_be16 (i, 1, (const uint16_t *) &ligGlyph);
+ }
else
{
- unsigned int lig_id = c->buffer->allocate_lig_id ();
- c->buffer->add_output_glyph (ligGlyph, 0, lig_id);
+ c->buffer->add_output_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
value it is later possible to check whether a specific
component value really belongs to a given ligature. */
- for ( i = 1; i < count; i++ )
+ for (i = 1; i < count; i++)
{
while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[c->buffer->i], c->lookup_flag, NULL))
- c->buffer->add_output_glyph (c->buffer->info[c->buffer->i].codepoint, i, lig_id);
+ {
+ 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);
+ }
/* Skip the base glyph */
c->buffer->i++;