Add HB_NO_SUBSET_LAYOUT

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
This commit is contained in:
Behdad Esfahbod 2019-04-12 22:50:22 -04:00
parent a98e4068e7
commit 47e538a35f
1 changed files with 9 additions and 1 deletions

View File

@ -47,7 +47,7 @@
#include "hb-ot-layout-gpos-table.hh" #include "hb-ot-layout-gpos-table.hh"
static unsigned int static HB_UNUSED unsigned int
_plan_estimate_subset_table_size (hb_subset_plan_t *plan, _plan_estimate_subset_table_size (hb_subset_plan_t *plan,
unsigned int table_len) unsigned int table_len)
{ {
@ -196,6 +196,8 @@ _subset_table (hb_subset_plan_t *plan,
case HB_OT_TAG_VORG: case HB_OT_TAG_VORG:
result = _subset<const OT::VORG> (plan); result = _subset<const OT::VORG> (plan);
break; break;
#if !defined(HB_NO_SUBSET_LAYOUT)
case HB_OT_TAG_GDEF: case HB_OT_TAG_GDEF:
result = _subset2<const OT::GDEF> (plan); result = _subset2<const OT::GDEF> (plan);
break; break;
@ -205,6 +207,7 @@ _subset_table (hb_subset_plan_t *plan,
case HB_OT_TAG_GPOS: case HB_OT_TAG_GPOS:
result = _subset2<const OT::GPOS> (plan); result = _subset2<const OT::GPOS> (plan);
break; break;
#endif
default: default:
hb_blob_t *source_table = hb_face_reference_table (plan->source, tag); hb_blob_t *source_table = hb_face_reference_table (plan->source, tag);
@ -230,11 +233,16 @@ _should_drop_table (hb_subset_plan_t *plan, hb_tag_t tag)
case HB_TAG ('h', 'd', 'm', 'x'): /* hint table, fallthrough */ case HB_TAG ('h', 'd', 'm', 'x'): /* hint table, fallthrough */
case HB_TAG ('V', 'D', 'M', 'X'): /* hint table, fallthrough */ case HB_TAG ('V', 'D', 'M', 'X'): /* hint table, fallthrough */
return plan->drop_hints; return plan->drop_hints;
// Drop Layout Tables if requested. // Drop Layout Tables if requested.
case HB_OT_TAG_GDEF: case HB_OT_TAG_GDEF:
case HB_OT_TAG_GPOS: case HB_OT_TAG_GPOS:
case HB_OT_TAG_GSUB: case HB_OT_TAG_GSUB:
#if defined(HB_NO_SUBSET_LAYOUT)
return true;
#endif
return plan->drop_layout; return plan->drop_layout;
// Drop these tables below by default, list pulled // Drop these tables below by default, list pulled
// from fontTools: // from fontTools:
case HB_TAG ('B', 'A', 'S', 'E'): case HB_TAG ('B', 'A', 'S', 'E'):