[OTLayout] Make table type known to apply context
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 13 Feb 2013 17:17:25 +0000 (12:17 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 13 Feb 2013 17:17:25 +0000 (12:17 -0500)
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout.cc
src/hb-ot-shape-complex-arabic-fallback.hh

index 04b29eb..752957b 100644 (file)
@@ -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_),
index 291ff9a..62988ab 100644 (file)
@@ -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);
 
index 4fcd0a2..c0dbff0 100644 (file)
@@ -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]);
     }
 }