We might reintroduce it later, but for now remove, as it was unused.
Some things that should have been in this object (drop_hints, etc)
are already in hb_subset_input_t. So, for now, keep everything there.
/**
* 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.
**/
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<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
#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_t>();
-}
-
-/**
- * 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<typename TableType>
static bool
_subset (hb_subset_plan_t *plan)
/**
* 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;
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
*
* Things that change based on the input. Characters to keep, etc.
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);
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;
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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;
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,
{
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);