Force-disable CFF code under disabling conditions
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 12 May 2019 17:29:47 +0000 (10:29 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 12 May 2019 17:29:47 +0000 (10:29 -0700)
Subsetter size goes down from 190kb to 119kb.  Main library about 7kb.

Part of https://github.com/harfbuzz/harfbuzz/issues/1652

src/hb-ot-cff1-table.cc
src/hb-ot-cff2-table.cc
src/hb-subset-cff1.cc
src/hb-subset-cff2.cc

index 2844f3c..e6dd6a7 100644 (file)
@@ -27,6 +27,8 @@
 #include "hb-ot-cff1-table.hh"
 #include "hb-cff1-interp-cs.hh"
 
+#ifndef HB_NO_CFF
+
 using namespace CFF;
 
 /* SID to code */
@@ -388,3 +390,5 @@ bool OT::cff1::accelerator_t::get_seac_components (hb_codepoint_t glyph, hb_code
   }
   return false;
 }
+
+#endif
index a1aaef6..f1fa6ec 100644 (file)
@@ -27,6 +27,8 @@
 #include "hb-ot-cff2-table.hh"
 #include "hb-cff2-interp-cs.hh"
 
+#ifndef HB_NO_OT_FONT_CFF
+
 using namespace CFF;
 
 struct extents_param_t
@@ -139,3 +141,5 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font,
 
   return true;
 }
+
+#endif
index ab3ad09..64b8b15 100644 (file)
@@ -32,6 +32,8 @@
 #include "hb-subset-cff-common.hh"
 #include "hb-cff1-interp-cs.hh"
 
+#ifndef HB_NO_SUBSET_CFF
+
 using namespace CFF;
 
 struct remap_sid_t : remap_t
@@ -1118,3 +1120,5 @@ hb_subset_cff1 (hb_subset_plan_t *plan,
 
   return result;
 }
+
+#endif
index 9a03c3e..7294578 100644 (file)
@@ -32,6 +32,8 @@
 #include "hb-subset-cff-common.hh"
 #include "hb-cff2-interp-cs.hh"
 
+#ifndef HB_NO_SUBSET_CFF
+
 using namespace CFF;
 
 struct cff2_sub_table_offsets_t : cff_sub_table_offsets_t
@@ -626,3 +628,5 @@ hb_subset_cff2 (hb_subset_plan_t *plan,
 
   return result;
 }
+
+#endif