unsigned int out_length;
unsigned int in_pos;
- hb_internal_glyph_info_t *in_string;
+ hb_internal_glyph_info_t *info;
hb_internal_glyph_info_t *out_string;
hb_internal_glyph_position_t *positions;
/* Here is how the buffer works internally:
*
- * There are two string pointers: in_string and out_string. They
+ * There are two string pointers: info and out_string. They
* always have same allocated size, but different length and positions.
*
- * As an optimization, both in_string and out_string may point to the
- * same piece of memory, which is owned by in_string. This remains the
+ * As an optimization, both info and out_string may point to the
+ * same piece of memory, which is owned by info. This remains the
* case as long as out_length doesn't exceed in_length at any time.
* In that case, swap() is no-op and the glyph operations operate mostly
* in-place.
*
- * As soon as out_string gets longer than in_string, out_string is moved over
+ * As soon as out_string gets longer than info, out_string is moved over
* to an alternate buffer (which we reuse the positions buffer for!), and its
* current contents (out_length entries) are copied to the alt buffer.
* This should all remain transparent to the user. swap() then switches
- * in_string and out_string.
+ * info and out_string.
*/
/* XXX err handling */
hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
{
hb_buffer_ensure (buffer, size);
- if (buffer->out_string == buffer->in_string)
+ if (buffer->out_string == buffer->info)
{
assert (buffer->have_output);
if (!buffer->positions)
buffer->positions = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->positions[0]));
buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions;
- memcpy (buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]));
+ memcpy (buffer->out_string, buffer->info, buffer->out_length * sizeof (buffer->out_string[0]));
}
}
hb_unicode_funcs_destroy (buffer->unicode);
- free (buffer->in_string);
+ free (buffer->info);
free (buffer->positions);
free (buffer);
buffer->in_length = 0;
buffer->out_length = 0;
buffer->in_pos = 0;
- buffer->out_string = buffer->in_string;
+ buffer->out_string = buffer->info;
buffer->max_lig_id = 0;
}
if (buffer->positions)
buffer->positions = (hb_internal_glyph_position_t *) realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0]));
- if (buffer->out_string != buffer->in_string)
+ if (buffer->out_string != buffer->info)
{
- buffer->in_string = (hb_internal_glyph_info_t *) realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
+ buffer->info = (hb_internal_glyph_info_t *) realloc (buffer->info, new_allocated * sizeof (buffer->info[0]));
buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions;
}
else
{
- buffer->in_string = (hb_internal_glyph_info_t *) realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
- buffer->out_string = buffer->in_string;
+ buffer->info = (hb_internal_glyph_info_t *) realloc (buffer->info, new_allocated * sizeof (buffer->info[0]));
+ buffer->out_string = buffer->info;
}
buffer->allocated = new_allocated;
hb_buffer_ensure (buffer, buffer->in_length + 1);
- glyph = &buffer->in_string[buffer->in_length];
+ glyph = &buffer->info[buffer->in_length];
glyph->codepoint = codepoint;
glyph->mask = mask;
glyph->cluster = cluster;
buffer->have_output = TRUE;
buffer->have_positions = FALSE;
buffer->out_length = 0;
- buffer->out_string = buffer->in_string;
+ buffer->out_string = buffer->info;
}
void
assert (buffer->have_output);
- if (buffer->out_string != buffer->in_string)
+ if (buffer->out_string != buffer->info)
{
hb_internal_glyph_info_t *tmp_string;
- tmp_string = buffer->in_string;
- buffer->in_string = buffer->out_string;
+ tmp_string = buffer->info;
+ buffer->info = buffer->out_string;
buffer->out_string = tmp_string;
buffer->positions = (hb_internal_glyph_position_t *) buffer->out_string;
}
unsigned int mask;
unsigned int cluster;
- if (buffer->out_string != buffer->in_string ||
+ if (buffer->out_string != buffer->info ||
buffer->out_length + num_out > buffer->in_pos + num_in)
{
hb_buffer_ensure_separate (buffer, buffer->out_length + num_out);
}
- mask = buffer->in_string[buffer->in_pos].mask;
- cluster = buffer->in_string[buffer->in_pos].cluster;
+ mask = buffer->info[buffer->in_pos].mask;
+ cluster = buffer->info[buffer->in_pos].cluster;
if (component == 0xFFFF)
- component = buffer->in_string[buffer->in_pos].component;
+ component = buffer->info[buffer->in_pos].component;
if (lig_id == 0xFFFF)
- lig_id = buffer->in_string[buffer->in_pos].lig_id;
+ lig_id = buffer->info[buffer->in_pos].lig_id;
for (i = 0; i < num_out; i++)
{
unsigned int mask;
unsigned int cluster;
- if (buffer->out_string != buffer->in_string ||
+ if (buffer->out_string != buffer->info ||
buffer->out_length + num_out > buffer->in_pos + num_in)
{
hb_buffer_ensure_separate (buffer, buffer->out_length + num_out);
}
- mask = buffer->in_string[buffer->in_pos].mask;
- cluster = buffer->in_string[buffer->in_pos].cluster;
+ mask = buffer->info[buffer->in_pos].mask;
+ cluster = buffer->info[buffer->in_pos].cluster;
if (component == 0xFFFF)
- component = buffer->in_string[buffer->in_pos].component;
+ component = buffer->info[buffer->in_pos].component;
if (lig_id == 0xFFFF)
- lig_id = buffer->in_string[buffer->in_pos].lig_id;
+ lig_id = buffer->info[buffer->in_pos].lig_id;
for (i = 0; i < num_out; i++)
{
{
hb_internal_glyph_info_t *info;
- if (buffer->out_string != buffer->in_string)
+ if (buffer->out_string != buffer->info)
{
hb_buffer_ensure (buffer, buffer->out_length + 1);
- buffer->out_string[buffer->out_length] = buffer->in_string[buffer->in_pos];
+ buffer->out_string[buffer->out_length] = buffer->info[buffer->in_pos];
}
else if (buffer->out_length != buffer->in_pos)
- buffer->out_string[buffer->out_length] = buffer->in_string[buffer->in_pos];
+ buffer->out_string[buffer->out_length] = buffer->info[buffer->in_pos];
info = &buffer->out_string[buffer->out_length];
info->codepoint = glyph_index;
{
if (buffer->have_output)
{
- if (buffer->out_string != buffer->in_string)
+ if (buffer->out_string != buffer->info)
{
hb_buffer_ensure (buffer, buffer->out_length + 1);
- buffer->out_string[buffer->out_length] = buffer->in_string[buffer->in_pos];
+ buffer->out_string[buffer->out_length] = buffer->info[buffer->in_pos];
}
else if (buffer->out_length != buffer->in_pos)
- buffer->out_string[buffer->out_length] = buffer->in_string[buffer->in_pos];
+ buffer->out_string[buffer->out_length] = buffer->info[buffer->in_pos];
buffer->out_length++;
}
hb_glyph_info_t *
hb_buffer_get_glyph_infos (hb_buffer_t *buffer)
{
- return (hb_glyph_info_t *) buffer->in_string;
+ return (hb_glyph_info_t *) buffer->info;
}
/* Return value valid as long as buffer not modified */
for (i = start, j = end - 1; i < j; i++, j--) {
hb_internal_glyph_info_t t;
- t = buffer->in_string[i];
- buffer->in_string[i] = buffer->in_string[j];
- buffer->in_string[j] = t;
+ t = buffer->info[i];
+ buffer->info[i] = buffer->info[j];
+ buffer->info[j] = t;
}
if (buffer->positions) {
count = buffer->in_length;
start = 0;
- last_cluster = buffer->in_string[0].cluster;
+ last_cluster = buffer->info[0].cluster;
for (i = 1; i < count; i++) {
- if (last_cluster != buffer->in_string[i].cluster) {
+ if (last_cluster != buffer->info[i].cluster) {
reverse_range (buffer, start, i);
start = i;
- last_cluster = buffer->in_string[i].cluster;
+ last_cluster = buffer->info[i].cluster;
}
}
reverse_range (buffer, start, i);
hb_position_t mark_x, mark_y, base_x, base_y;
- mark_anchor.get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &mark_x, &mark_y);
- glyph_anchor.get_anchor (c->layout, c->buffer->in_string[glyph_pos].codepoint, &base_x, &base_y);
+ 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];
o.x_advance = 0;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
const PairValueRecord *record = CastP<PairValueRecord> (array);
for (unsigned int i = 0; i < count; i++)
{
- if (c->buffer->in_string[pos].codepoint == record->secondGlyph)
+ 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]);
if (unlikely (c->buffer->in_pos + 2 > end))
return false;
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
unsigned int j = c->buffer->in_pos + 1;
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
{
if (unlikely (j == end))
return false;
if (unlikely (c->buffer->in_pos + 2 > end))
return false;
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
unsigned int j = c->buffer->in_pos + 1;
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
{
if (unlikely (j == end))
return false;
unsigned int len2 = valueFormat2.get_len ();
unsigned int record_len = len1 + len2;
- unsigned int klass1 = (this+classDef1) (c->buffer->in_string[c->buffer->in_pos].codepoint);
- unsigned int klass2 = (this+classDef2) (c->buffer->in_string[j].codepoint);
+ unsigned int klass1 = (this+classDef1) (c->buffer->info[c->buffer->in_pos].codepoint);
+ unsigned int klass2 = (this+classDef2) (c->buffer->info[j].codepoint);
if (unlikely (klass1 >= class1Count || klass2 >= class2Count))
return false;
if (c->property == HB_OT_LAYOUT_GLYPH_CLASS_MARK)
return false;
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
goto end;
hb_position_t entry_x, entry_y;
- (this+record.entryAnchor).get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &entry_x, &entry_y);
+ (this+record.entryAnchor).get_anchor (c->layout, c->buffer->info[c->buffer->in_pos].codepoint, &entry_x, &entry_y);
/* TODO vertical */
if (record.exitAnchor)
{
gpi->last = c->buffer->in_pos;
- (this+record.exitAnchor).get_anchor (c->layout, c->buffer->in_string[c->buffer->in_pos].codepoint, &gpi->anchor_x, &gpi->anchor_y);
+ (this+record.exitAnchor).get_anchor (c->layout, c->buffer->info[c->buffer->in_pos].codepoint, &gpi->anchor_x, &gpi->anchor_y);
}
c->buffer->in_pos++;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark_index = (this+markCoverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int mark_index = (this+markCoverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (mark_index == NOT_COVERED))
return false;
if (unlikely (!j))
return false;
j--;
- } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], LookupFlag::IgnoreMarks, &property));
+ } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], LookupFlag::IgnoreMarks, &property));
/* The following assertion is too strong, so we've disabled it. */
if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH))
return false;
- unsigned int base_index = (this+baseCoverage) (c->buffer->in_string[j].codepoint);
+ unsigned int base_index = (this+baseCoverage) (c->buffer->info[j].codepoint);
if (base_index == NOT_COVERED)
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark_index = (this+markCoverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int mark_index = (this+markCoverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (mark_index == NOT_COVERED))
return false;
if (unlikely (!j))
return false;
j--;
- } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], LookupFlag::IgnoreMarks, &property));
+ } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], LookupFlag::IgnoreMarks, &property));
/* The following assertion is too strong, so we've disabled it. */
if (false && !(property & HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE))
return false;
- unsigned int lig_index = (this+ligatureCoverage) (c->buffer->in_string[j].codepoint);
+ unsigned int lig_index = (this+ligatureCoverage) (c->buffer->info[j].codepoint);
if (lig_index == NOT_COVERED)
return false;
* is identical to the ligature ID of the found ligature. If yes, we
* can directly use the component index. If not, we attach the mark
* glyph to the last component of the ligature. */
- if (c->buffer->in_string[j].lig_id && c->buffer->in_string[j].lig_id == c->buffer->in_string[c->buffer->in_pos].lig_id && c->buffer->in_string[c->buffer->in_pos].component)
+ if (c->buffer->info[j].lig_id && c->buffer->info[j].lig_id == c->buffer->info[c->buffer->in_pos].lig_id && c->buffer->info[c->buffer->in_pos].component)
{
- comp_index = c->buffer->in_string[c->buffer->in_pos].component - 1;
+ comp_index = c->buffer->info[c->buffer->in_pos].component - 1;
if (comp_index >= comp_count)
comp_index = comp_count - 1;
}
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- unsigned int mark1_index = (this+mark1Coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int mark1_index = (this+mark1Coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (mark1_index == NOT_COVERED))
return false;
if (unlikely (!j))
return false;
j--;
- } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, &property));
+ } while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, &property));
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
return false;
/* Two marks match only if they belong to the same base, or same component
* of the same ligature. That is, the component numbers must match, and
* if those are non-zero, the ligid number should also match. */
- if ((c->buffer->in_string[j].component != c->buffer->in_string[c->buffer->in_pos].component) ||
- (c->buffer->in_string[j].component && c->buffer->in_string[j].lig_id != c->buffer->in_string[c->buffer->in_pos].lig_id))
+ if ((c->buffer->info[j].component != c->buffer->info[c->buffer->in_pos].component) ||
+ (c->buffer->info[j].component && c->buffer->info[j].lig_id != c->buffer->info[c->buffer->in_pos].lig_id))
return false;
- unsigned int mark2_index = (this+mark2Coverage) (c->buffer->in_string[j].codepoint);
+ unsigned int mark2_index = (this+mark2Coverage) (c->buffer->info[j].codepoint);
if (mark2_index == NOT_COVERED)
return false;
c->nesting_level_left = nesting_level_left;
c->lookup_flag = get_flag ();
- if (!_hb_ot_layout_check_glyph_property (c->layout->face, &c->buffer->in_string[c->buffer->in_pos], c->lookup_flag, &c->property))
+ if (!_hb_ot_layout_check_glyph_property (c->layout->face, &c->buffer->info[c->buffer->in_pos], c->lookup_flag, &c->property))
return false;
for (unsigned int i = 0; i < get_subtable_count (); i++)
while (buffer->in_pos < buffer->in_length)
{
bool done;
- if (~buffer->in_string[buffer->in_pos].mask & mask)
+ if (~buffer->info[buffer->in_pos].mask & mask)
{
done = apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL);
ret |= done;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
+ hb_codepoint_t glyph_id = c->buffer->info[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
+ hb_codepoint_t glyph_id = c->buffer->info[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
return false;
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
+ hb_codepoint_t glyph_id = c->buffer->info[c->buffer->in_pos].codepoint;
unsigned int index = (this+coverage) (glyph_id);
if (likely (index == NOT_COVERED))
for (i = 1, j = c->buffer->in_pos + 1; i < count; i++, j++)
{
unsigned int property;
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, &property))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, &property))
{
if (unlikely (j + count - i == end))
return false;
if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
is_mark = false;
- if (likely (c->buffer->in_string[j].codepoint != component[i]))
+ if (likely (c->buffer->info[j].codepoint != component[i]))
return false;
}
/* This is just a guess ... */
c->buffer->add_output_glyphs_be16 (i,
1, (const uint16_t *) &ligGlyph,
0,
- c->buffer->in_string[c->buffer->in_pos].lig_id && !c->buffer->in_string[c->buffer->in_pos].component ?
+ c->buffer->info[c->buffer->in_pos].lig_id && !c->buffer->info[c->buffer->in_pos].component ?
0xFFFF : c->buffer->allocate_lig_id ());
else
{
for ( i = 1; i < count; i++ )
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[c->buffer->in_pos], c->lookup_flag, NULL))
- c->buffer->add_output_glyph (c->buffer->in_string[c->buffer->in_pos].codepoint, i, lig_id);
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[c->buffer->in_pos], c->lookup_flag, NULL))
+ c->buffer->add_output_glyph (c->buffer->info[c->buffer->in_pos].codepoint, i, lig_id);
(c->buffer->in_pos)++;
}
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY ();
- hb_codepoint_t glyph_id = c->buffer->in_string[c->buffer->in_pos].codepoint;
+ hb_codepoint_t glyph_id = c->buffer->info[c->buffer->in_pos].codepoint;
bool first_is_mark = !!(c->property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
if (unlikely (c->context_length != NO_CONTEXT))
return false; /* No chaining to this type */
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
match_coverage, this,
1))
{
- c->buffer->in_string[c->buffer->in_pos].codepoint = substitute[index];
+ c->buffer->info[c->buffer->in_pos].codepoint = substitute[index];
c->buffer->in_pos--; /* Reverse! */
return true;
}
c->nesting_level_left = nesting_level_left;
c->lookup_flag = get_flag ();
- if (!_hb_ot_layout_check_glyph_property (c->layout->face, &c->buffer->in_string[c->buffer->in_pos], c->lookup_flag, &c->property))
+ if (!_hb_ot_layout_check_glyph_property (c->layout->face, &c->buffer->info[c->buffer->in_pos], c->lookup_flag, &c->property))
return false;
if (unlikely (lookup_type == SubstLookupSubTable::Extension))
buffer->in_pos = 0;
while (buffer->in_pos < buffer->in_length)
{
- if ((~buffer->in_string[buffer->in_pos].mask & mask) &&
+ if ((~buffer->info[buffer->in_pos].mask & mask) &&
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
ret = true;
else
buffer->in_pos = buffer->in_length - 1;
do
{
- if ((~buffer->in_string[buffer->in_pos].mask & mask) &&
+ if ((~buffer->info[buffer->in_pos].mask & mask) &&
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
ret = true;
else
for (i = 1, j = c->buffer->in_pos + 1; i < count; i++, j++)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
{
if (unlikely (j + count - i == end))
return false;
j++;
}
- if (likely (!match_func (c->buffer->in_string[j].codepoint, input[i - 1], match_data)))
+ if (likely (!match_func (c->buffer->info[j].codepoint, input[i - 1], match_data)))
return false;
}
for (i = 0, j = c->buffer->in_pos + offset; i < count; i++, j++)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
{
if (unlikely (j + count - i == end))
return false;
j++;
}
- if (likely (!match_func (c->buffer->in_string[j].codepoint, lookahead[i], match_data)))
+ if (likely (!match_func (c->buffer->info[j].codepoint, lookahead[i], match_data)))
return false;
}
*/
for (unsigned int i = 0; i < count; /* NOP */)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->in_string[c->buffer->in_pos], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[c->buffer->in_pos], c->lookup_flag, NULL))
{
if (unlikely (c->buffer->in_pos == end))
return true;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
const ClassDef &class_def = this+classDef;
- index = class_def (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ index = class_def (c->buffer->info[c->buffer->in_pos].codepoint);
const RuleSet &rule_set = this+ruleSet[index];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage[0]) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage[0]) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
inline bool apply (hb_apply_context_t *c, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
- unsigned int index = (this+coverage) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+coverage) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
const ClassDef &input_class_def = this+inputClassDef;
const ClassDef &lookahead_class_def = this+lookaheadClassDef;
- index = input_class_def (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ index = input_class_def (c->buffer->info[c->buffer->in_pos].codepoint);
const ChainRuleSet &rule_set = this+ruleSet[index];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
TRACE_APPLY ();
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
- unsigned int index = (this+input[0]) (c->buffer->in_string[c->buffer->in_pos].codepoint);
+ unsigned int index = (this+input[0]) (c->buffer->info[c->buffer->in_pos].codepoint);
if (likely (index == NOT_COVERED))
return false;
count = buffer->in_length;
for (buffer->in_pos = 1; buffer->in_pos < count; buffer->in_pos++)
- if (buffer->unicode->get_general_category (buffer->in_string[buffer->in_pos].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
- buffer->in_string[buffer->in_pos].cluster = buffer->in_string[buffer->in_pos - 1].cluster;
+ if (buffer->unicode->get_general_category (buffer->info[buffer->in_pos].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
+ buffer->info[buffer->in_pos].cluster = buffer->info[buffer->in_pos - 1].cluster;
}
static hb_direction_t
count = buffer->in_length;
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
- buffer->in_string[buffer->in_pos].codepoint = get_mirroring (buffer->in_string[buffer->in_pos].codepoint);
+ buffer->info[buffer->in_pos].codepoint = get_mirroring (buffer->info[buffer->in_pos].codepoint);
}
}
return;
count = buffer->in_length - 1;
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
- if (unlikely (is_variation_selector (buffer->in_string[buffer->in_pos + 1].codepoint))) {
- buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, buffer->in_string[buffer->in_pos + 1].codepoint);
+ if (unlikely (is_variation_selector (buffer->info[buffer->in_pos + 1].codepoint))) {
+ buffer->info[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->info[buffer->in_pos].codepoint, buffer->info[buffer->in_pos + 1].codepoint);
buffer->in_pos++;
} else {
- buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, 0);
+ buffer->info[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->info[buffer->in_pos].codepoint, 0);
}
}
- buffer->in_string[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->in_string[buffer->in_pos].codepoint, 0);
+ buffer->info[buffer->in_pos].codepoint = hb_font_get_glyph (font, face, buffer->info[buffer->in_pos].codepoint, 0);
}
static void
count = buffer->in_length;
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->in_string[buffer->in_pos].codepoint, &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;
}
count = buffer->in_length;
for (buffer->in_pos = 1; buffer->in_pos < count; buffer->in_pos++) {
hb_position_t kern, kern1, kern2;
- kern = hb_font_get_kerning (font, face, buffer->in_string[buffer->in_pos - 1].codepoint, buffer->in_string[buffer->in_pos].codepoint);
+ 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;