diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 1f643dc08..7efa1c19b 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -135,7 +135,7 @@ _create_old_gid_to_new_gid_map (const hb_vector_t &glyphs, /** * hb_subset_plan_create: * Computes a plan for subsetting the supplied face according - * to a provide profile and input. The plan describes + * to a provided input. The plan describes * which tables and glyphs should be retained. * * Return value: New subset plan. @@ -144,7 +144,6 @@ _create_old_gid_to_new_gid_map (const hb_vector_t &glyphs, **/ hb_subset_plan_t * hb_subset_plan_create (hb_face_t *face, - hb_subset_profile_t *profile, hb_subset_input_t *input) { hb_subset_plan_t *plan = hb_object_create (); diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 0f44f4b23..a5be50a6a 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -97,7 +97,6 @@ typedef struct hb_subset_plan_t hb_subset_plan_t; HB_INTERNAL hb_subset_plan_t * hb_subset_plan_create (hb_face_t *face, - hb_subset_profile_t *profile, hb_subset_input_t *input); HB_INTERNAL void diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 1ba160591..1695d3710 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -43,37 +43,6 @@ #include "hb-ot-post-table.hh" -struct hb_subset_profile_t { - hb_object_header_t header; - ASSERT_POD (); -}; - -/** - * hb_subset_profile_create: - * - * Return value: New profile with default settings. - * - * Since: 1.8.0 - **/ -hb_subset_profile_t * -hb_subset_profile_create () -{ - return hb_object_create(); -} - -/** - * hb_subset_profile_destroy: - * - * Since: 1.8.0 - **/ -void -hb_subset_profile_destroy (hb_subset_profile_t *profile) -{ - if (!hb_object_destroy (profile)) return; - - free (profile); -} - template static bool _subset (hb_subset_plan_t *plan) @@ -198,19 +167,17 @@ _should_drop_table(hb_subset_plan_t *plan, hb_tag_t tag) /** * hb_subset: * @source: font face data to be subset. - * @profile: profile to use for the subsetting. * @input: input to use for the subsetting. * - * Subsets a font according to provided profile and input. + * Subsets a font according to provided input. **/ hb_face_t * hb_subset (hb_face_t *source, - hb_subset_profile_t *profile, hb_subset_input_t *input) { - if (unlikely (!profile || !input || !source)) return hb_face_get_empty(); + if (unlikely (!input || !source)) return hb_face_get_empty(); - hb_subset_plan_t *plan = hb_subset_plan_create (source, profile, input); + hb_subset_plan_t *plan = hb_subset_plan_create (source, input); hb_tag_t table_tags[32]; unsigned int offset = 0, count; diff --git a/src/hb-subset.h b/src/hb-subset.h index 8b7fcc6c9..3b39706db 100644 --- a/src/hb-subset.h +++ b/src/hb-subset.h @@ -31,20 +31,6 @@ HB_BEGIN_DECLS -/* - * hb_subset_profile_t - * Things that change based on target environment, e.g. OS. - * Threadsafe for multiple concurrent subset operations. - */ - -typedef struct hb_subset_profile_t hb_subset_profile_t; - -HB_EXTERN hb_subset_profile_t * -hb_subset_profile_create (void); - -HB_EXTERN void -hb_subset_profile_destroy (hb_subset_profile_t *profile); - /* * hb_subset_input_t * @@ -74,10 +60,10 @@ hb_subset_input_drop_hints (hb_subset_input_t *subset_input); HB_EXTERN hb_bool_t * hb_subset_input_drop_ot_layout (hb_subset_input_t *subset_input); + /* hb_subset() */ HB_EXTERN hb_face_t * hb_subset (hb_face_t *source, - hb_subset_profile_t *profile, hb_subset_input_t *input); diff --git a/test/api/hb-subset-test.h b/test/api/hb-subset-test.h index c34f394b9..afd553a0d 100644 --- a/test/api/hb-subset-test.h +++ b/test/api/hb-subset-test.h @@ -72,11 +72,9 @@ static inline hb_face_t * hb_subset_test_create_subset (hb_face_t *source, hb_subset_input_t *input) { - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (source, profile, input); + hb_face_t *subset = hb_subset (source, input); g_assert (subset); - hb_subset_profile_destroy (profile); hb_subset_input_destroy (input); return subset; } diff --git a/test/api/test-subset-hdmx.c b/test/api/test-subset-hdmx.c index c78009b6b..22fcb4118 100644 --- a/test/api/test-subset-hdmx.c +++ b/test/api/test-subset-hdmx.c @@ -61,13 +61,11 @@ test_subset_hdmx_invalid (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset == hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } @@ -83,13 +81,11 @@ test_subset_hdmx_fails_sanitize (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset == hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } diff --git a/test/api/test-subset-hmtx.c b/test/api/test-subset-hmtx.c index 0ed62562b..8b57ca7c6 100644 --- a/test/api/test-subset-hmtx.c +++ b/test/api/test-subset-hmtx.c @@ -161,13 +161,11 @@ test_subset_invalid_hmtx (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset == hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } diff --git a/test/api/test-subset.c b/test/api/test-subset.c index 6d2bf06e1..b0a3446c7 100644 --- a/test/api/test-subset.c +++ b/test/api/test-subset.c @@ -40,13 +40,11 @@ test_subset_32_tables (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset != hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } @@ -62,13 +60,11 @@ test_subset_no_inf_loop (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset == hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } @@ -84,13 +80,11 @@ test_subset_crash (void) hb_set_add (codepoints, 'b'); hb_set_add (codepoints, 'c'); - hb_subset_profile_t *profile = hb_subset_profile_create(); - hb_face_t *subset = hb_subset (face, profile, input); + hb_face_t *subset = hb_subset (face, input); g_assert (subset); g_assert (subset == hb_face_get_empty ()); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); hb_face_destroy (subset); hb_face_destroy (face); } diff --git a/test/fuzzing/hb-subset-fuzzer.cc b/test/fuzzing/hb-subset-fuzzer.cc index 28ce921c8..108f6ec1e 100644 --- a/test/fuzzing/hb-subset-fuzzer.cc +++ b/test/fuzzing/hb-subset-fuzzer.cc @@ -12,8 +12,6 @@ void trySubset (hb_face_t *face, bool drop_hints, bool drop_ot_layout) { - hb_subset_profile_t *profile = hb_subset_profile_create (); - hb_subset_input_t *input = hb_subset_input_create_or_fail (); *hb_subset_input_drop_hints (input) = drop_hints; *hb_subset_input_drop_ot_layout (input) = drop_ot_layout; @@ -24,11 +22,10 @@ void trySubset (hb_face_t *face, hb_set_add (codepoints, text[i]); } - hb_face_t *result = hb_subset (face, profile, input); + hb_face_t *result = hb_subset (face, input); hb_face_destroy (result); hb_subset_input_destroy (input); - hb_subset_profile_destroy (profile); } void trySubset (hb_face_t *face, diff --git a/util/hb-subset.cc b/util/hb-subset.cc index a15495fa2..f333be8a2 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -92,17 +92,15 @@ struct subset_consumer_t { input->drop_hints = subset_options.drop_hints; - hb_subset_profile_t *subset_profile = hb_subset_profile_create(); hb_face_t *face = hb_font_get_face (font); - hb_face_t *new_face = hb_subset(face, subset_profile, input); + hb_face_t *new_face = hb_subset(face, input); hb_blob_t *result = hb_face_reference_blob (new_face); failed = !hb_blob_get_length (result); if (!failed) write_file (options.output_file, result); - hb_subset_profile_destroy (subset_profile); hb_subset_input_destroy (input); hb_blob_destroy (result); hb_face_destroy (new_face);