[subset] Run once for a tag
This commit is contained in:
parent
0954c8f7a0
commit
8ccf328d54
|
@ -285,21 +285,24 @@ hb_subset (hb_face_t *source,
|
||||||
hb_tag_t table_tags[32];
|
hb_tag_t table_tags[32];
|
||||||
unsigned int offset = 0, count;
|
unsigned int offset = 0, count;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
hb_set_t *tags_set = hb_set_create ();
|
||||||
do {
|
do {
|
||||||
count = ARRAY_LENGTH (table_tags);
|
count = ARRAY_LENGTH (table_tags);
|
||||||
hb_face_get_table_tags (source, offset, &count, table_tags);
|
hb_face_get_table_tags (source, offset, &count, table_tags);
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
hb_tag_t tag = table_tags[i];
|
hb_tag_t tag = table_tags[i];
|
||||||
if (_should_drop_table (plan, tag))
|
if (_should_drop_table (plan, tag) && !hb_set_has (tags_set, tag))
|
||||||
{
|
{
|
||||||
DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag));
|
DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
hb_set_add (tags_set, tag);
|
||||||
success = success && _subset_table (plan, tag);
|
success = success && _subset_table (plan, tag);
|
||||||
}
|
}
|
||||||
offset += count;
|
offset += count;
|
||||||
} while (success && count == ARRAY_LENGTH (table_tags));
|
} while (success && count == ARRAY_LENGTH (table_tags));
|
||||||
|
hb_set_destroy (tags_set);
|
||||||
|
|
||||||
hb_face_t *result = success ? hb_face_reference (plan->dest) : hb_face_get_empty ();
|
hb_face_t *result = success ? hb_face_reference (plan->dest) : hb_face_get_empty ();
|
||||||
hb_subset_plan_destroy (plan);
|
hb_subset_plan_destroy (plan);
|
||||||
|
|
Loading…
Reference in New Issue