From 5b436033851960ea3638fbf882100b8c04d6d5a3 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 4 Feb 2020 21:29:19 +0330 Subject: [PATCH] [subset] Rename _subset2 to _subset --- src/hb-subset.cc | 62 ++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 413ab8e10..5a07bc8e5 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -69,7 +69,7 @@ _plan_estimate_subset_table_size (hb_subset_plan_t *plan, template static bool -_subset2 (hb_subset_plan_t *plan) +_subset (hb_subset_plan_t *plan) { bool result = false; hb_blob_t *source_blob = hb_sanitize_context_t ().reference_table (plan->source); @@ -133,26 +133,6 @@ _subset2 (hb_subset_plan_t *plan) return result; } -template -static bool -_subset (hb_subset_plan_t *plan) -{ - hb_blob_t *source_blob = hb_sanitize_context_t ().reference_table (plan->source); - const TableType *table = source_blob->as (); - - hb_tag_t tag = TableType::tableTag; - hb_bool_t result = false; - if (source_blob->data) - result = table->subset (plan); - else - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset sanitize failed on source table.", HB_UNTAG (tag)); - - hb_blob_destroy (source_blob); - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG (tag), result ? "success" : "FAILED!"); - return result; -} - - static bool _subset_table (hb_subset_plan_t *plan, hb_tag_t tag) @@ -161,13 +141,13 @@ _subset_table (hb_subset_plan_t *plan, bool result = true; switch (tag) { case HB_OT_TAG_glyf: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_hdmx: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_name: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_head: // TODO that won't work well if there is no glyf @@ -178,66 +158,66 @@ _subset_table (hb_subset_plan_t *plan, DEBUG_MSG(SUBSET, nullptr, "skip hhea handled by hmtx"); return true; case HB_OT_TAG_hmtx: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_vhea: DEBUG_MSG(SUBSET, nullptr, "skip vhea handled by vmtx"); return true; case HB_OT_TAG_vmtx: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_maxp: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_sbix: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_loca: DEBUG_MSG(SUBSET, nullptr, "skip loca handled by glyf"); return true; case HB_OT_TAG_cmap: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_OS2: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_post: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_COLR: - result = _subset2 (plan); + result = _subset (plan); break; #ifndef HB_NO_SUBSET_CFF case HB_OT_TAG_cff1: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_cff2: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_VORG: - result = _subset2 (plan); + result = _subset (plan); break; #endif #ifndef HB_NO_SUBSET_LAYOUT case HB_OT_TAG_GDEF: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_GSUB: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_GPOS: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_gvar: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_HVAR: - result = _subset2 (plan); + result = _subset (plan); break; case HB_OT_TAG_VVAR: - result = _subset2 (plan); + result = _subset (plan); break; #endif