[subset] Apply script list filter when doing layout collection.
This commit is contained in:
parent
e5c8a2f4e1
commit
41d2c335bc
|
@ -136,28 +136,25 @@ static void _collect_layout_indices (hb_subset_plan_t *plan,
|
||||||
features.resize (num_features);
|
features.resize (num_features);
|
||||||
bool retain_all_features = !_filter_tag_list (&features, plan->layout_features);
|
bool retain_all_features = !_filter_tag_list (&features, plan->layout_features);
|
||||||
|
|
||||||
if (!plan->check_success (!features.in_error ()) || !features)
|
unsigned num_scripts = table.get_script_count () + 1;
|
||||||
return;
|
hb_vector_t<hb_tag_t> scripts;
|
||||||
|
if (!plan->check_success (scripts.resize (num_scripts))) return;
|
||||||
|
table.get_script_tags (0, &num_scripts, scripts.arrayZ);
|
||||||
|
scripts.resize (num_scripts);
|
||||||
|
bool retain_all_scripts = !_filter_tag_list (&scripts, plan->layout_scripts);
|
||||||
|
|
||||||
if (retain_all_features)
|
if (!plan->check_success (!features.in_error ()) || !features
|
||||||
{
|
|| !plan->check_success (!scripts.in_error ()) || !scripts)
|
||||||
// Looking for all features, trigger the faster collection method.
|
|
||||||
layout_collect_func (plan->source,
|
|
||||||
T::tableTag,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
indices);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// The collect function needs a null element to signal end of the array.
|
// The collect function needs a null element to signal end of the array.
|
||||||
features.push (0);
|
features.push (0);
|
||||||
|
scripts.push (0);
|
||||||
layout_collect_func (plan->source,
|
layout_collect_func (plan->source,
|
||||||
T::tableTag,
|
T::tableTag,
|
||||||
|
retain_all_scripts ? nullptr : scripts.arrayZ,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
retain_all_features ? nullptr : features.arrayZ,
|
||||||
features.arrayZ,
|
|
||||||
indices);
|
indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue