[subset-cff] Simplify a bit

This commit is contained in:
Behdad Esfahbod 2023-06-22 20:09:36 -06:00
parent e1753782c1
commit ad025ddf05
9 changed files with 7 additions and 86 deletions

View file

@ -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 \

View file

@ -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<cff1_private_dict_opset_subset, cff1_private_dict_values_subset_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);

View file

@ -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<cff2_private_dict_opset_subset_t, cff2_private_dict_values_subset_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<HBUINT8> version; /* Version of CFF2 table. set to 0x0200u */

View file

@ -527,6 +527,9 @@ struct cff_subset_accelerator_t
hb_vector_t<parsed_cs_str_vec_t> parsed_local_subrs;
mutable hb_atomic_ptr_t<hb_vector_t<uint16_t>> glyph_to_sid_map = nullptr;
void *cff1_acc = nullptr;
void *cff2_acc = nullptr;
private:
hb_blob_t* original_blob;
};

View file

@ -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);

View file

@ -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 */

View file

@ -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);

View file

@ -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 */

View file

@ -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',