提交 25e9173f 编写于 作者: G Garret Rieger 提交者: Behdad Esfahbod

Make hb-subset-plan private.

上级 af46a4da
...@@ -189,7 +189,7 @@ HB_SUBSET_sources = \ ...@@ -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)
......
...@@ -24,15 +24,15 @@ ...@@ -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, ...@@ -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) ...@@ -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);
} }
...@@ -24,26 +24,30 @@ ...@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册