[subset-plan] Simplify no_subset_tables allocation
This commit is contained in:
parent
999be72135
commit
c51d33685d
|
@ -848,7 +848,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
|
||||||
plan->layout_scripts = *input->sets.layout_scripts;
|
plan->layout_scripts = *input->sets.layout_scripts;
|
||||||
plan->glyphs_requested = hb_set_copy (input->sets.glyphs);
|
plan->glyphs_requested = hb_set_copy (input->sets.glyphs);
|
||||||
plan->drop_tables = *input->sets.drop_tables;
|
plan->drop_tables = *input->sets.drop_tables;
|
||||||
plan->no_subset_tables = hb_set_copy (input->sets.no_subset_tables);
|
plan->no_subset_tables = *input->sets.no_subset_tables;
|
||||||
plan->source = hb_face_reference (face);
|
plan->source = hb_face_reference (face);
|
||||||
plan->dest = hb_face_builder_create ();
|
plan->dest = hb_face_builder_create ();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ struct hb_subset_plan_t
|
||||||
{
|
{
|
||||||
hb_set_destroy (unicodes);
|
hb_set_destroy (unicodes);
|
||||||
hb_set_destroy (glyphs_requested);
|
hb_set_destroy (glyphs_requested);
|
||||||
hb_set_destroy (no_subset_tables);
|
|
||||||
hb_face_destroy (source);
|
hb_face_destroy (source);
|
||||||
hb_face_destroy (dest);
|
hb_face_destroy (dest);
|
||||||
hb_map_destroy (codepoint_to_glyph);
|
hb_map_destroy (codepoint_to_glyph);
|
||||||
|
@ -110,7 +109,7 @@ struct hb_subset_plan_t
|
||||||
hb_set_t *glyphs_requested;
|
hb_set_t *glyphs_requested;
|
||||||
|
|
||||||
// Tables which should not be processed, just pass them through.
|
// Tables which should not be processed, just pass them through.
|
||||||
hb_set_t *no_subset_tables;
|
hb_set_t no_subset_tables;
|
||||||
|
|
||||||
// Tables which should be dropped.
|
// Tables which should be dropped.
|
||||||
hb_set_t drop_tables;
|
hb_set_t drop_tables;
|
||||||
|
|
|
@ -168,11 +168,11 @@ _get_table_tags (const hb_subset_plan_t* plan,
|
||||||
hb_concat (
|
hb_concat (
|
||||||
+ hb_array (known_tables)
|
+ hb_array (known_tables)
|
||||||
| hb_filter ([&] (hb_tag_t tag) {
|
| hb_filter ([&] (hb_tag_t tag) {
|
||||||
return !_table_is_empty (plan->source, tag) && !plan->no_subset_tables->has (tag);
|
return !_table_is_empty (plan->source, tag) && !plan->no_subset_tables.has (tag);
|
||||||
})
|
})
|
||||||
| hb_map ([] (hb_tag_t tag) -> hb_tag_t { return tag; }),
|
| hb_map ([] (hb_tag_t tag) -> hb_tag_t { return tag; }),
|
||||||
|
|
||||||
plan->no_subset_tables->iter ()
|
plan->no_subset_tables.iter ()
|
||||||
| hb_filter([&] (hb_tag_t tag) {
|
| hb_filter([&] (hb_tag_t tag) {
|
||||||
return !_table_is_empty (plan->source, tag);
|
return !_table_is_empty (plan->source, tag);
|
||||||
}));
|
}));
|
||||||
|
@ -424,7 +424,7 @@ _subset_table (hb_subset_plan_t *plan,
|
||||||
hb_vector_t<char> &buf,
|
hb_vector_t<char> &buf,
|
||||||
hb_tag_t tag)
|
hb_tag_t tag)
|
||||||
{
|
{
|
||||||
if (plan->no_subset_tables->has (tag)) {
|
if (plan->no_subset_tables.has (tag)) {
|
||||||
return _passthrough (plan, tag);
|
return _passthrough (plan, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue