typedef void (*pause_func_t) (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer);
- struct pause_map_t {
+ struct stage_map_t {
unsigned int num_lookups; /* Cumulative */
pause_func_t callback;
};
*lookup_count = 0;
return;
}
- assert (stage <= pauses[table_index].len);
- unsigned int start = stage ? pauses[table_index][stage - 1].num_lookups : 0;
- unsigned int end = stage < pauses[table_index].len ? pauses[table_index][stage].num_lookups : lookups[table_index].len;
+ assert (stage <= stages[table_index].len);
+ unsigned int start = stage ? stages[table_index][stage - 1].num_lookups : 0;
+ unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].num_lookups : lookups[table_index].len;
*plookups = &lookups[table_index][start];
*lookup_count = end - start;
}
features.finish ();
lookups[0].finish ();
lookups[1].finish ();
- pauses[0].finish ();
- pauses[1].finish ();
+ stages[0].finish ();
+ stages[1].finish ();
}
public:
hb_prealloced_array_t<feature_map_t, 8> features;
hb_prealloced_array_t<lookup_map_t, 32> lookups[2]; /* GSUB/GPOS */
- hb_prealloced_array_t<pause_map_t, 1> pauses[2]; /* GSUB/GPOS */
+ hb_prealloced_array_t<stage_map_t, 1> stages[2]; /* GSUB/GPOS */
};
enum hb_ot_map_feature_flags_t {
inline void finish (void) {
feature_infos.finish ();
- pauses[0].finish ();
- pauses[1].finish ();
+ stages[0].finish ();
+ stages[1].finish ();
}
private:
{ return (a->tag != b->tag) ? (a->tag < b->tag ? -1 : 1) : (a->seq < b->seq ? -1 : 1); }
};
- struct pause_info_t {
- unsigned int stage;
+ struct stage_info_t {
+ unsigned int index;
hb_ot_map_t::pause_func_t callback;
};
unsigned int current_stage[2]; /* GSUB/GPOS */
hb_prealloced_array_t<feature_info_t,16> feature_infos;
- hb_prealloced_array_t<pause_info_t, 1> pauses[2]; /* GSUB/GPOS */
+ hb_prealloced_array_t<stage_info_t, 1> stages[2]; /* GSUB/GPOS */
};
const unsigned int table_index = 0;
unsigned int i = 0;
- for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) {
- const pause_map_t *pause = &pauses[table_index][pause_index];
- for (; i < pause->num_lookups; i++)
+ for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
+ const stage_map_t *stage = &stages[table_index][stage_index];
+ for (; i < stage->num_lookups; i++)
hb_ot_layout_substitute_lookup (font, buffer,
lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (pause->callback)
+ if (stage->callback)
{
buffer->clear_output ();
- pause->callback (plan, font, buffer);
+ stage->callback (plan, font, buffer);
}
}
}
const unsigned int table_index = 1;
unsigned int i = 0;
- for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) {
- const pause_map_t *pause = &pauses[table_index][pause_index];
- for (; i < pause->num_lookups; i++)
+ for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
+ const stage_map_t *stage = &stages[table_index][stage_index];
+ for (; i < stage->num_lookups; i++)
hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (pause->callback)
- pause->callback (plan, font, buffer);
+ if (stage->callback)
+ stage->callback (plan, font, buffer);
}
}
void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func)
{
- pause_info_t *p = pauses[table_index].push ();
- if (likely (p)) {
- p->stage = current_stage[table_index];
- p->callback = pause_func;
+ stage_info_t *s = stages[table_index].push ();
+ if (likely (s)) {
+ s->index = current_stage[table_index];
+ s->callback = pause_func;
}
current_stage[table_index]++;
&required_feature_index))
m.add_lookups (face, table_index, required_feature_index, 1, true);
- unsigned int pause_index = 0;
+ unsigned int stage_index = 0;
unsigned int last_num_lookups = 0;
for (unsigned stage = 0; stage < current_stage[table_index]; stage++)
{
last_num_lookups = m.lookups[table_index].len;
- if (pause_index < pauses[table_index].len && pauses[table_index][pause_index].stage == stage) {
- hb_ot_map_t::pause_map_t *pause_map = m.pauses[table_index].push ();
+ if (stage_index < stages[table_index].len && stages[table_index][stage_index].index == stage) {
+ hb_ot_map_t::stage_map_t *pause_map = m.stages[table_index].push ();
if (likely (pause_map)) {
pause_map->num_lookups = last_num_lookups;
- pause_map->callback = pauses[table_index][pause_index].callback;
+ pause_map->callback = stages[table_index][stage_index].callback;
}
- pause_index++;
+ stage_index++;
}
}
}