[GSUB] Add GSUB::substitute_lookup()
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 16 May 2009 00:11:10 +0000 (20:11 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 2 Nov 2009 19:40:08 +0000 (14:40 -0500)
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout.cc

index 2bf1e9f..3980c6c 100644 (file)
@@ -692,6 +692,7 @@ struct ContextSubstFormat1 {
 };
 ASSERT_SIZE (ContextSubstFormat1, 6);
 
+
 struct SubClassRule {
   /* TODO */
 
@@ -1177,6 +1178,12 @@ struct GSUB : GSUBGPOS {
     return *(SubstLookup*)&(((GSUBGPOS *)this)->get_lookup (i));
   }
 
+  inline bool substitute_lookup (hb_ot_layout_t *layout,
+                                hb_buffer_t    *buffer,
+                                unsigned int    lookup_index,
+                                hb_ot_layout_feature_mask_t  mask) const {
+    return get_lookup (lookup_index).substitute_string (layout, buffer, mask);
+  }
 
 };
 DEFINE_NULL_ALIAS (GSUB, GSUBGPOS);
index 0cbc1bf..1d696c7 100644 (file)
@@ -529,10 +529,7 @@ hb_ot_layout_substitute_lookup (hb_ot_layout_t              *layout,
                                unsigned int                 lookup_index,
                                hb_ot_layout_feature_mask_t  mask)
 {
-  const GSUB &gsub = *(layout->gsub);
-  const SubstLookup &l = gsub.get_lookup (lookup_index);
-
-  return l.substitute_string (layout, buffer, mask);
+  return layout->gsub->substitute_lookup (layout, buffer, lookup_index, mask);
 }