Make hb-subset-plan private.

This commit is contained in:
Garret Rieger 2018-02-05 17:26:25 -08:00 committed by Behdad Esfahbod
parent af46a4da5a
commit 25e9173fe8
3 changed files with 30 additions and 21 deletions

View File

@ -189,7 +189,7 @@ HB_SUBSET_sources = \
HB_SUBSET_headers = \ HB_SUBSET_headers = \
hb-subset.h \ hb-subset.h \
hb-subset-plan.h \ hb-subset-plan.hh \
hb-subset-private.hh \ hb-subset-private.hh \
$(NULL) $(NULL)

View File

@ -24,15 +24,15 @@
* Google Author(s): Garret Rieger * Google Author(s): Garret Rieger
*/ */
#include "hb-private.hh" #include "hb-subset-plan.hh"
#include "hb-subset-private.hh"
#include "hb-object-private.hh" hb_set_t *
get_glyph_ids_from_cmap (hb_face_t *face,
hb_set_t *codepoints)
struct hb_subset_plan_t { {
hb_object_header_t header; return hb_set_get_empty ();
ASSERT_POD (); }
};
/** /**
* hb_subset_plan_create: * hb_subset_plan_create:
@ -49,13 +49,17 @@ hb_subset_plan_create (hb_face_t *face,
hb_subset_profile_t *profile, hb_subset_profile_t *profile,
hb_subset_input_t *input) hb_subset_input_t *input)
{ {
return hb_object_create<hb_subset_plan_t>(); hb_subset_plan_t *plan = hb_object_create<hb_subset_plan_t> ();
plan->glyphs_to_retain = get_glyph_ids_from_cmap (face, input->codepoints);
return plan;
} }
hb_subset_plan_t * hb_subset_plan_t *
hb_subset_plan_create_empty () hb_subset_plan_get_empty ()
{ {
return hb_object_create<hb_subset_plan_t>(); hb_subset_plan_t *plan = hb_object_create<hb_subset_plan_t> ();
plan->glyphs_to_retain = hb_set_get_empty();
return plan;
} }
/** /**
@ -68,5 +72,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan)
{ {
if (!hb_object_destroy (plan)) return; if (!hb_object_destroy (plan)) return;
hb_set_destroy (plan->glyphs_to_retain);
free (plan); free (plan);
} }

View File

@ -24,26 +24,30 @@
* Google Author(s): Garret Rieger * Google Author(s): Garret Rieger
*/ */
#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
#ifndef HB_SUBSET_PLAN_H #ifndef HB_SUBSET_PLAN_H
#define HB_SUBSET_PLAN_H #define HB_SUBSET_PLAN_H
HB_BEGIN_DECLS #include "hb-private.hh"
#include "hb-object-private.hh"
struct hb_subset_plan_t {
hb_object_header_t header;
ASSERT_POD ();
hb_set_t *glyphs_to_retain;
};
typedef struct hb_subset_plan_t hb_subset_plan_t; typedef struct hb_subset_plan_t hb_subset_plan_t;
HB_EXTERN hb_subset_plan_t * hb_subset_plan_t *
hb_subset_plan_create (hb_face_t *face, hb_subset_plan_create (hb_face_t *face,
hb_subset_profile_t *profile, hb_subset_profile_t *profile,
hb_subset_input_t *input); hb_subset_input_t *input);
HB_EXTERN hb_subset_plan_t * hb_subset_plan_t *
hb_subset_plan_create_empty (); hb_subset_plan_get_empty ();
HB_EXTERN void void
hb_subset_plan_destroy (hb_subset_plan_t *plan); hb_subset_plan_destroy (hb_subset_plan_t *plan);
#endif /* HB_SUBSET_PLAN_PRIVATE_HH */ #endif /* HB_SUBSET_PLAN_PRIVATE_HH */