From 25e9173fe8446735f7e36ec963c7d3554c85631b Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Mon, 5 Feb 2018 17:26:25 -0800 Subject: [PATCH] Make hb-subset-plan private. --- src/Makefile.sources | 2 +- src/hb-subset-plan.cc | 27 ++++++++++++--------- src/{hb-subset-plan.h => hb-subset-plan.hh} | 22 ++++++++++------- 3 files changed, 30 insertions(+), 21 deletions(-) rename src/{hb-subset-plan.h => hb-subset-plan.hh} (86%) diff --git a/src/Makefile.sources b/src/Makefile.sources index 5e1c4e4f6..0d5af3243 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -189,7 +189,7 @@ HB_SUBSET_sources = \ HB_SUBSET_headers = \ hb-subset.h \ - hb-subset-plan.h \ + hb-subset-plan.hh \ hb-subset-private.hh \ $(NULL) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 7da9dae8f..8111d519b 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -24,15 +24,15 @@ * Google Author(s): Garret Rieger */ -#include "hb-private.hh" +#include "hb-subset-plan.hh" +#include "hb-subset-private.hh" -#include "hb-object-private.hh" - - -struct hb_subset_plan_t { - hb_object_header_t header; - ASSERT_POD (); -}; +hb_set_t * +get_glyph_ids_from_cmap (hb_face_t *face, + hb_set_t *codepoints) +{ + return hb_set_get_empty (); +} /** * hb_subset_plan_create: @@ -49,13 +49,17 @@ hb_subset_plan_create (hb_face_t *face, hb_subset_profile_t *profile, hb_subset_input_t *input) { - return hb_object_create(); + hb_subset_plan_t *plan = hb_object_create (); + plan->glyphs_to_retain = get_glyph_ids_from_cmap (face, input->codepoints); + return plan; } hb_subset_plan_t * -hb_subset_plan_create_empty () +hb_subset_plan_get_empty () { - return hb_object_create(); + hb_subset_plan_t *plan = hb_object_create (); + 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; + hb_set_destroy (plan->glyphs_to_retain); free (plan); } diff --git a/src/hb-subset-plan.h b/src/hb-subset-plan.hh similarity index 86% rename from src/hb-subset-plan.h rename to src/hb-subset-plan.hh index 2fd46ae27..54b1e651d 100644 --- a/src/hb-subset-plan.h +++ b/src/hb-subset-plan.hh @@ -24,26 +24,30 @@ * Google Author(s): Garret Rieger */ -#ifndef HB_H_IN -#error "Include instead." -#endif - #ifndef 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; -HB_EXTERN hb_subset_plan_t * +hb_subset_plan_t * hb_subset_plan_create (hb_face_t *face, hb_subset_profile_t *profile, hb_subset_input_t *input); -HB_EXTERN hb_subset_plan_t * -hb_subset_plan_create_empty (); +hb_subset_plan_t * +hb_subset_plan_get_empty (); -HB_EXTERN void +void hb_subset_plan_destroy (hb_subset_plan_t *plan); #endif /* HB_SUBSET_PLAN_PRIVATE_HH */