hb_internal_glyph_info_t *info;
hb_internal_glyph_info_t *out_info;
- hb_internal_glyph_position_t *positions;
+ hb_internal_glyph_position_t *pos;
/* Other stuff */
- unsigned int max_lig_id;
+ unsigned int max_lig_id;
/* Methods */
if (buffer->out_info == buffer->info)
{
assert (buffer->have_output);
- if (!buffer->positions)
- buffer->positions = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->positions[0]));
+ if (!buffer->pos)
+ buffer->pos = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->pos[0]));
- buffer->out_info = (hb_internal_glyph_info_t *) buffer->positions;
+ buffer->out_info = (hb_internal_glyph_info_t *) buffer->pos;
memcpy (buffer->out_info, buffer->info, buffer->out_length * sizeof (buffer->out_info[0]));
}
}
hb_unicode_funcs_destroy (buffer->unicode);
free (buffer->info);
- free (buffer->positions);
+ free (buffer->pos);
free (buffer);
}
while (size > new_allocated)
new_allocated += (new_allocated >> 1) + 8;
- if (buffer->positions)
- buffer->positions = (hb_internal_glyph_position_t *) realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0]));
+ if (buffer->pos)
+ buffer->pos = (hb_internal_glyph_position_t *) realloc (buffer->pos, new_allocated * sizeof (buffer->pos[0]));
if (buffer->out_info != buffer->info)
{
buffer->info = (hb_internal_glyph_info_t *) realloc (buffer->info, new_allocated * sizeof (buffer->info[0]));
- buffer->out_info = (hb_internal_glyph_info_t *) buffer->positions;
+ buffer->out_info = (hb_internal_glyph_info_t *) buffer->pos;
}
else
{
buffer->have_output = FALSE;
buffer->have_positions = TRUE;
- if (unlikely (!buffer->positions))
+ if (unlikely (!buffer->pos))
{
- buffer->positions = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->positions[0]));
+ buffer->pos = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->pos[0]));
return;
}
- memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length);
+ memset (buffer->pos, 0, sizeof (buffer->pos[0]) * buffer->in_length);
}
void
tmp_string = buffer->info;
buffer->info = buffer->out_info;
buffer->out_info = tmp_string;
- buffer->positions = (hb_internal_glyph_position_t *) buffer->out_info;
+ buffer->pos = (hb_internal_glyph_position_t *) buffer->out_info;
}
tmp = buffer->in_length;
if (!buffer->have_positions)
hb_buffer_clear_positions (buffer);
- return (hb_glyph_position_t *) buffer->positions;
+ return (hb_glyph_position_t *) buffer->pos;
}
buffer->info[j] = t;
}
- if (buffer->positions) {
+ if (buffer->pos) {
for (i = 0, j = end - 1; i < j; i++, j--) {
hb_internal_glyph_position_t t;
- t = buffer->positions[i];
- buffer->positions[i] = buffer->positions[j];
- buffer->positions[j] = t;
+ t = buffer->pos[i];
+ buffer->pos[i] = buffer->pos[j];
+ buffer->pos[j] = t;
}
}
}
mark_anchor.get_anchor (c->layout, c->buffer->info[c->buffer->in_pos].codepoint, &mark_x, &mark_y);
glyph_anchor.get_anchor (c->layout, c->buffer->info[glyph_pos].codepoint, &base_x, &base_y);
- hb_internal_glyph_position_t &o = c->buffer->positions[c->buffer->in_pos];
+ hb_internal_glyph_position_t &o = c->buffer->pos[c->buffer->in_pos];
o.x_advance = 0;
o.y_advance = 0;
o.x_offset = base_x - mark_x;
if (likely (index == NOT_COVERED))
return false;
- valueFormat.apply_value (c->layout, this, values, c->buffer->positions[c->buffer->in_pos]);
+ valueFormat.apply_value (c->layout, this, values, c->buffer->pos[c->buffer->in_pos]);
c->buffer->in_pos++;
return true;
valueFormat.apply_value (c->layout, this,
&values[index * valueFormat.get_len ()],
- c->buffer->positions[c->buffer->in_pos]);
+ c->buffer->pos[c->buffer->in_pos]);
c->buffer->in_pos++;
return true;
{
if (c->buffer->info[pos].codepoint == record->secondGlyph)
{
- valueFormats[0].apply_value (c->layout, this, &record->values[0], c->buffer->positions[c->buffer->in_pos]);
- valueFormats[1].apply_value (c->layout, this, &record->values[len1], c->buffer->positions[pos]);
+ valueFormats[0].apply_value (c->layout, this, &record->values[0], c->buffer->pos[c->buffer->in_pos]);
+ valueFormats[1].apply_value (c->layout, this, &record->values[len1], c->buffer->pos[pos]);
if (len2)
pos++;
c->buffer->in_pos = pos;
return false;
const Value *v = &values[record_len * (klass1 * class2Count + klass2)];
- valueFormat1.apply_value (c->layout, this, v, c->buffer->positions[c->buffer->in_pos]);
- valueFormat2.apply_value (c->layout, this, v + len1, c->buffer->positions[j]);
+ valueFormat1.apply_value (c->layout, this, v, c->buffer->pos[c->buffer->in_pos]);
+ valueFormat2.apply_value (c->layout, this, v + len1, c->buffer->pos[j]);
if (len2)
j++;
if (c->buffer->direction == HB_DIRECTION_RTL)
{
/* advance is absolute, not relative */
- c->buffer->positions[c->buffer->in_pos].x_advance = entry_x - gpi->anchor_x;
+ c->buffer->pos[c->buffer->in_pos].x_advance = entry_x - gpi->anchor_x;
}
else
{
/* advance is absolute, not relative */
- c->buffer->positions[last_pos].x_advance = gpi->anchor_x - entry_x;
+ c->buffer->pos[last_pos].x_advance = gpi->anchor_x - entry_x;
}
if (c->lookup_flag & LookupFlag::RightToLeft)
{
- c->buffer->positions[last_pos].cursive_chain = last_pos - c->buffer->in_pos;
- c->buffer->positions[last_pos].y_offset = entry_y - gpi->anchor_y;
+ c->buffer->pos[last_pos].cursive_chain = last_pos - c->buffer->in_pos;
+ c->buffer->pos[last_pos].y_offset = entry_y - gpi->anchor_y;
}
else
{
- c->buffer->positions[c->buffer->in_pos].cursive_chain = c->buffer->in_pos - last_pos;
- c->buffer->positions[c->buffer->in_pos].y_offset = gpi->anchor_y - entry_y;
+ c->buffer->pos[c->buffer->in_pos].cursive_chain = c->buffer->in_pos - last_pos;
+ c->buffer->pos[c->buffer->in_pos].y_offset = gpi->anchor_y - entry_y;
}
end:
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
hb_glyph_metrics_t metrics;
hb_font_get_glyph_metrics (font, face, buffer->info[buffer->in_pos].codepoint, &metrics);
- buffer->positions[buffer->in_pos].x_advance = metrics.x_advance;
- buffer->positions[buffer->in_pos].y_advance = metrics.y_advance;
+ buffer->pos[buffer->in_pos].x_advance = metrics.x_advance;
+ buffer->pos[buffer->in_pos].y_advance = metrics.y_advance;
}
}
kern = hb_font_get_kerning (font, face, buffer->info[buffer->in_pos - 1].codepoint, buffer->info[buffer->in_pos].codepoint);
kern1 = kern >> 1;
kern2 = kern - kern1;
- buffer->positions[buffer->in_pos - 1].x_advance += kern1;
- buffer->positions[buffer->in_pos].x_advance += kern2;
- buffer->positions[buffer->in_pos].x_offset += kern2;
+ buffer->pos[buffer->in_pos - 1].x_advance += kern1;
+ buffer->pos[buffer->in_pos].x_advance += kern2;
+ buffer->pos[buffer->in_pos].x_offset += kern2;
}
}