From 6880f7e19d44c50e45ecb86d26381aad956d9acb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 13 Feb 2013 12:17:25 -0500 Subject: [PATCH] [OTLayout] Make table type known to apply context --- src/hb-ot-layout-gsubgpos-private.hh | 5 ++++- src/hb-ot-layout.cc | 4 ++-- src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 04b29eb51..752957bd4 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -255,6 +255,7 @@ struct hb_apply_context_t return ret; } + unsigned int table_index; /* GSUB/GPOS */ hb_font_t *font; hb_face_t *face; hb_buffer_t *buffer; @@ -268,9 +269,11 @@ struct hb_apply_context_t unsigned int debug_depth; - hb_apply_context_t (hb_font_t *font_, + hb_apply_context_t (unsigned int table_index_, + hb_font_t *font_, hb_buffer_t *buffer_, hb_mask_t lookup_mask_) : + table_index (table_index_), font (font_), face (font->face), buffer (buffer_), direction (buffer_->props.direction), lookup_mask (lookup_mask_), diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 291ff9a95..62988ab09 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -670,7 +670,7 @@ hb_ot_layout_substitute_lookup (hb_font_t *font, { if (unlikely (lookup_index >= hb_ot_layout_from_face (font->face)->gsub_lookup_count)) return false; - OT::hb_apply_context_t c (font, buffer, mask); + OT::hb_apply_context_t c (0, font, buffer, mask); const OT::SubstLookup& l = hb_ot_layout_from_face (font->face)->gsub->get_lookup (lookup_index); @@ -719,7 +719,7 @@ hb_ot_layout_position_lookup (hb_font_t *font, { if (unlikely (lookup_index >= hb_ot_layout_from_face (font->face)->gpos_lookup_count)) return false; - OT::hb_apply_context_t c (font, buffer, mask); + OT::hb_apply_context_t c (1, font, buffer, mask); const OT::PosLookup& l = hb_ot_layout_from_face (font->face)->gpos->get_lookup (lookup_index); diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 4fcd0a2fd..c0dbff0f8 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -244,7 +244,7 @@ arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan, { for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++) if (fallback_plan->lookup_array[i]) { - OT::hb_apply_context_t c (font, buffer, fallback_plan->mask_array[i]); + OT::hb_apply_context_t c (0, font, buffer, fallback_plan->mask_array[i]); fallback_plan->lookup_array[i]->apply_string (&c, &fallback_plan->digest_array[i]); } }