diff --git a/src/Makefile.sources b/src/Makefile.sources index 931f0790e..fbbff5325 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -365,9 +365,7 @@ HB_SUBSET_sources = \ hb-subset-cff-common.cc \ hb-subset-cff-common.hh \ hb-subset-cff1.cc \ - hb-subset-cff1.hh \ hb-subset-cff2.cc \ - hb-subset-cff2.hh \ hb-subset-input.cc \ hb-subset-input.hh \ hb-subset-instancer-solver.hh \ diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 506acecab..c8387a0c7 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -28,7 +28,6 @@ #define HB_OT_CFF1_TABLE_HH #include "hb-ot-cff-common.hh" -#include "hb-subset-cff1.hh" #include "hb-draw.hh" #include "hb-paint.hh" @@ -1487,7 +1486,7 @@ struct cff1 struct accelerator_subset_t : accelerator_templ_t {}; - bool subset (hb_subset_context_t *c) const { return hb_subset_cff1 (c); } + HB_INTERNAL bool subset (hb_subset_context_t *c) const; protected: HB_INTERNAL static hb_codepoint_t lookup_standard_encoding_for_code (hb_codepoint_t sid); diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index f966312e6..8f2747108 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -28,7 +28,6 @@ #define HB_OT_CFF2_TABLE_HH #include "hb-ot-cff-common.hh" -#include "hb-subset-cff2.hh" #include "hb-draw.hh" #include "hb-paint.hh" @@ -519,7 +518,7 @@ struct cff2 typedef accelerator_templ_t accelerator_subset_t; - bool subset (hb_subset_context_t *c) const { return hb_subset_cff2 (c); } + HB_INTERNAL bool subset (hb_subset_context_t *c) const; public: FixedVersion version; /* Version of CFF2 table. set to 0x0200u */ diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index a11a46ef7..8c61a53b1 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -527,6 +527,9 @@ struct cff_subset_accelerator_t hb_vector_t parsed_local_subrs; mutable hb_atomic_ptr_t> glyph_to_sid_map = nullptr; + void *cff1_acc = nullptr; + void *cff2_acc = nullptr; + private: hb_blob_t* original_blob; }; diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index d79a4bc6d..21d16cbd3 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -32,7 +32,6 @@ #include "hb-ot-cff1-table.hh" #include "hb-set.h" #include "hb-bimap.hh" -#include "hb-subset-cff1.hh" #include "hb-subset-plan.hh" #include "hb-subset-cff-common.hh" #include "hb-cff1-interp-cs.hh" @@ -956,7 +955,7 @@ _hb_subset_cff1 (const OT::cff1::accelerator_subset_t &acc, } bool -hb_subset_cff1 (hb_subset_context_t *c) +OT::cff1::subset (hb_subset_context_t *c) const { OT::cff1::accelerator_subset_t acc; acc.init (c->plan->source); diff --git a/src/hb-subset-cff1.hh b/src/hb-subset-cff1.hh deleted file mode 100644 index aaf5def1e..000000000 --- a/src/hb-subset-cff1.hh +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2018 Adobe Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Adobe Author(s): Michiharu Ariza - */ - -#ifndef HB_SUBSET_CFF1_HH -#define HB_SUBSET_CFF1_HH - -#include "hb.hh" - -#include "hb-subset-plan.hh" - -HB_INTERNAL bool -hb_subset_cff1 (hb_subset_context_t *c); - -#endif /* HB_SUBSET_CFF1_HH */ diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 888d888b5..f34961c08 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -31,7 +31,6 @@ #include "hb-open-type.hh" #include "hb-ot-cff2-table.hh" #include "hb-set.h" -#include "hb-subset-cff2.hh" #include "hb-subset-plan.hh" #include "hb-subset-cff-common.hh" #include "hb-cff2-interp-cs.hh" @@ -650,7 +649,7 @@ _hb_subset_cff2 (const OT::cff2::accelerator_subset_t &acc, } bool -hb_subset_cff2 (hb_subset_context_t *c) +OT::cff2::subset (hb_subset_context_t *c) const { OT::cff2::accelerator_subset_t acc (c->plan->source); return acc.is_valid () && _hb_subset_cff2 (acc, c); diff --git a/src/hb-subset-cff2.hh b/src/hb-subset-cff2.hh deleted file mode 100644 index f10556ddd..000000000 --- a/src/hb-subset-cff2.hh +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2018 Adobe Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Adobe Author(s): Michiharu Ariza - */ - -#ifndef HB_SUBSET_CFF2_HH -#define HB_SUBSET_CFF2_HH - -#include "hb.hh" - -#include "hb-subset-plan.hh" - -HB_INTERNAL bool -hb_subset_cff2 (hb_subset_context_t *c); - -#endif /* HB_SUBSET_CFF2_HH */ diff --git a/src/meson.build b/src/meson.build index d14c3c09e..a002cd59e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -366,9 +366,7 @@ hb_subset_sources = files( 'hb-subset-cff-common.cc', 'hb-subset-cff-common.hh', 'hb-subset-cff1.cc', - 'hb-subset-cff1.hh', 'hb-subset-cff2.cc', - 'hb-subset-cff2.hh', 'hb-subset-input.cc', 'hb-subset-input.hh', 'hb-subset-instancer-solver.hh',