[config] Disable AAT map
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 20 Jun 2019 00:08:26 +0000 (17:08 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 20 Jun 2019 00:09:55 +0000 (17:09 -0700)
Part of https://github.com/harfbuzz/harfbuzz/issues/1652

src/hb-aat-map.cc
src/hb-ot-shape.cc

index d57ee84..e16ecfe 100644 (file)
  * Google Author(s): Behdad Esfahbod
  */
 
+#include "hb.hh"
+
+#ifndef HB_NO_SHAPE_AAT
+
 #include "hb-aat-map.hh"
 
 #include "hb-aat-layout.hh"
 void hb_aat_map_builder_t::add_feature (hb_tag_t tag,
                                        unsigned int value)
 {
-#ifdef HB_NO_SHAPE_AAT
-  return;
-#endif
-
   if (tag == HB_TAG ('a','a','l','t'))
   {
     feature_info_t *info = features.push();
@@ -57,10 +57,6 @@ void hb_aat_map_builder_t::add_feature (hb_tag_t tag,
 void
 hb_aat_map_builder_t::compile (hb_aat_map_t  &m)
 {
-#ifdef HB_NO_SHAPE_AAT
-  return;
-#endif
-
   /* Sort features and merge duplicates */
   if (features.length)
   {
@@ -74,3 +70,6 @@ hb_aat_map_builder_t::compile (hb_aat_map_t  &m)
 
   hb_aat_layout_compile_map (this, &m);
 }
+
+
+#endif
index 20dbac2..7690c22 100644 (file)
@@ -98,8 +98,10 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t           &plan,
   plan.props = props;
   plan.shaper = shaper;
   map.compile (plan.map, key);
+#ifndef HB_NO_SHAPE_AAT
   if (apply_morx)
     aat_map.compile (plan.aat_map);
+#endif
 
 #ifndef HB_NO_OT_SHAPE_FRACTIONS
   plan.frac_mask = plan.map.get_1_mask (HB_TAG ('f','r','a','c'));
@@ -201,7 +203,9 @@ hb_ot_shape_plan_t::init0 (hb_face_t                     *face,
                           const hb_shape_plan_key_t     *key)
 {
   map.init ();
+#ifndef HB_NO_SHAPE_AAT
   aat_map.init ();
+#endif
 
   hb_ot_shape_planner_t planner (face,
                                 &key->props);
@@ -229,7 +233,9 @@ hb_ot_shape_plan_t::fini ()
     shaper->data_destroy (const_cast<void *> (data));
 
   map.fini ();
+#ifndef HB_NO_SHAPE_AAT
   aat_map.fini ();
+#endif
 }
 
 void