diff --git a/src/Makefile.sources b/src/Makefile.sources index 5e1c4e4f6c6f5dd2b6fd113b53e11320d0c055bc..0d5af32439331252e98c256747246415b7e11216 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 7da9dae8f2e7f6262280773ae05387e06e3d42a5..8111d519b479ab1e3f5a89d13ad2da357ea7e925 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 2fd46ae27fae12d9b80a445c5b080a1ae102f7e0..54b1e651dbe6f37067a6a035b13586f23e477bfb 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 */