mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
[subset] layout_features filtering fix
we should not use get_size (), which returns length * item_size
This commit is contained in:
1 parent
3160789701
commit
903a6baece
12 files changed
+29
-3
No files matched your search
+15
-3
@@ -100,11 +100,23 @@ static void _collect_layout_indices (hb_face_t *face,
|
||||
if (!features.alloc (table.get_feature_count () + 1))
|
||||
return;
|
||||
|
||||
hb_set_t visited_features;
|
||||
bool retain_all_features = true;
|
||||
for (unsigned i = 0; i < table.get_feature_count (); i++)
|
||||
{
|
||||
hb_tag_t tag = table.get_feature_tag (i);
|
||||
if (tag && layout_features_to_retain->has (tag))
|
||||
features.push (tag);
|
||||
if (!tag) continue;
|
||||
if (!layout_features_to_retain->has (tag))
|
||||
{
|
||||
retain_all_features = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (visited_features.has (tag))
|
||||
continue;
|
||||
|
||||
features.push (tag);
|
||||
visited_features.add (tag);
|
||||
}
|
||||
|
||||
if (!features)
|
||||
@@ -113,7 +125,7 @@ static void _collect_layout_indices (hb_face_t *face,
|
||||
// The collect function needs a null element to signal end of the array.
|
||||
features.push (0);
|
||||
|
||||
if (features.get_size () == table.get_feature_count () + 1)
|
||||
if (retain_all_features)
|
||||
{
|
||||
// Looking for all features, trigger the faster collection method.
|
||||
layout_collect_func (face,
|
||||
|
||||
@@ -38,6 +38,7 @@ EXTRA_DIST += \
|
||||
expected/layout.gdef-attachlist \
|
||||
expected/layout.notonastaliqurdu \
|
||||
expected/layout.tinos \
|
||||
expected/layout.default_features \
|
||||
expected/layout.duplicate_features \
|
||||
expected/layout.unsorted_featurelist \
|
||||
expected/layout.drop_feature \
|
||||
|
||||
@@ -36,6 +36,7 @@ TESTS = \
|
||||
tests/layout.notonastaliqurdu.tests \
|
||||
tests/layout.tests \
|
||||
tests/layout.tinos.tests \
|
||||
tests/layout.default_features.tests \
|
||||
tests/layout.duplicate_features.tests \
|
||||
tests/layout.unsorted_featurelist.tests \
|
||||
tests/layout.drop_feature.tests \
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
FONTS:
|
||||
FranklinGothic-Regular.ttf
|
||||
|
||||
PROFILES:
|
||||
layout-test.txt
|
||||
default.txt
|
||||
retain-gids.txt
|
||||
|
||||
SUBSETS:
|
||||
achi
|
||||
*
|
||||
@@ -33,6 +33,7 @@ tests = [
|
||||
'layout.duplicate_features',
|
||||
'layout.unsorted_featurelist',
|
||||
'layout.drop_feature',
|
||||
'layout.default_features',
|
||||
'cmap',
|
||||
'cmap14',
|
||||
'sbix',
|
||||
|
||||
Reference in new issue
Block a user