#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-layout-gpos-table.hh"
+#include "hb-ot-map-private.hh"
+
#include <stdlib.h>
#include <string.h>
return false;
}
+
+
+/*
+ * Parts of hb-ot-map are implemented here such that they have direct
+ * access to GSUB/GPOS lookups.
+ */
+
+
+inline void hb_ot_map_t::apply (unsigned int table_index,
+ const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer) const
+{
+ unsigned int i = 0;
+
+ 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->last_lookup; i++)
+ switch (table_index)
+ {
+ case 0:
+ hb_ot_layout_substitute_lookup (font, buffer, lookups[table_index][i].index,
+ lookups[table_index][i].mask,
+ lookups[table_index][i].auto_zwj);
+ break;
+
+ case 1:
+ hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
+ lookups[table_index][i].mask,
+ lookups[table_index][i].auto_zwj);
+ break;
+ }
+
+ if (stage->pause_func)
+ {
+ buffer->clear_output ();
+ stage->pause_func (plan, font, buffer);
+ }
+ }
+}
+
+void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const
+{
+ apply (0, plan, font, buffer);
+}
+
+void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const
+{
+ apply (1, plan, font, buffer);
+}
info->stage[1] = current_stage[1];
}
-inline void hb_ot_map_t::apply (unsigned int table_index,
- const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer) const
-{
- unsigned int i = 0;
-
- 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->last_lookup; i++)
- switch (table_index)
- {
- case 0:
- hb_ot_layout_substitute_lookup (font, buffer, lookups[table_index][i].index,
- lookups[table_index][i].mask,
- lookups[table_index][i].auto_zwj);
- break;
-
- case 1:
- hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
- lookups[table_index][i].mask,
- lookups[table_index][i].auto_zwj);
- break;
- }
-
- if (stage->pause_func)
- {
- buffer->clear_output ();
- stage->pause_func (plan, font, buffer);
- }
- }
-}
-
-void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const
-{
- apply (0, plan, font, buffer);
-}
-
-void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const
-{
- apply (1, plan, font, buffer);
-}
-
void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_out) const
{