Move hb_ot_layout_closure_{features,lookups} behind EXPERIMENTAL flag
diff --git a/src/gen-def.py b/src/gen-def.py
index f89582a..b852932 100755
--- a/src/gen-def.py
+++ b/src/gen-def.py
@@ -34,7 +34,9 @@
hb_draw_funcs_set_line_to_func
hb_draw_funcs_set_move_to_func
hb_draw_funcs_set_quadratic_to_func
-hb_font_get_var_coords_design""".splitlines ()
+hb_font_get_var_coords_design
+hb_ot_layout_closure_lookups
+hb_ot_layout_closure_features""".splitlines ()
symbols = [x for x in symbols if x not in experimental_symbols]
symbols = "\n".join (symbols)
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index bc28529..1777dda 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -1203,6 +1203,7 @@
g.feature_variation_collect_lookups (&feature_indexes, lookup_indexes);
}
+#ifdef HB_EXPERIMENTAL_API
/**
* hb_ot_layout_closure_lookups:
* @face: #hb_face_t to work upon
@@ -1266,6 +1267,7 @@
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
g.closure_features (lookup_indexes, feature_indexes);
}
+#endif
#ifndef HB_NO_LAYOUT_COLLECT_GLYPHS
diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h
index 3625f91..0bd6616 100644
--- a/src/hb-ot-layout.h
+++ b/src/hb-ot-layout.h
@@ -263,6 +263,7 @@
const hb_tag_t *features,
hb_set_t *lookup_indexes /* OUT */);
+#ifdef HB_EXPERIMENTAL_API
HB_EXTERN void
hb_ot_layout_closure_lookups (hb_face_t *face,
hb_tag_t table_tag,
@@ -274,6 +275,7 @@
hb_tag_t table_tag,
const hb_map_t *lookup_indexes, /* IN */
hb_set_t *feature_indexes /* OUT */);
+#endif
HB_EXTERN void
hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc
index 672b748..9e59be2 100644
--- a/src/hb-subset-plan.cc
+++ b/src/hb-subset-plan.cc
@@ -51,6 +51,7 @@
#endif
#ifndef HB_NO_SUBSET_LAYOUT
+#ifdef HB_EXPERIMENTAL_API
static void
_remap_indexes (const hb_set_t *indexes,
hb_map_t *mapping /* OUT */)
@@ -61,6 +62,7 @@
mapping->set (_.first, _.second);
}
+#endif
static inline void
_gsub_closure_glyphs_lookups_features (hb_face_t *face,
@@ -78,6 +80,7 @@
hb_ot_layout_lookups_substitute_closure (face,
&lookup_indices,
gids_to_retain);
+#ifdef HB_EXPERIMENTAL_API
hb_ot_layout_closure_lookups (face,
HB_OT_TAG_GSUB,
gids_to_retain,
@@ -91,6 +94,7 @@
gsub_lookups,
&feature_indices);
_remap_indexes (&feature_indices, gsub_features);
+#endif
}
static inline void
@@ -106,6 +110,7 @@
nullptr,
nullptr,
&lookup_indices);
+#ifdef HB_EXPERIMENTAL_API
hb_ot_layout_closure_lookups (face,
HB_OT_TAG_GPOS,
gids_to_retain,
@@ -119,6 +124,7 @@
gpos_lookups,
&feature_indices);
_remap_indexes (&feature_indices, gpos_features);
+#endif
}
#endif
diff --git a/test/api/test-ot-face.c b/test/api/test-ot-face.c
index a857d5b..5eac868 100644
--- a/test/api/test-ot-face.c
+++ b/test/api/test-ot-face.c
@@ -75,12 +75,16 @@
hb_set_t *lookup_indexes = hb_set_create ();
hb_set_add (lookup_indexes, 0);
+#ifdef HB_EXPERIMENTAL_API
hb_ot_layout_closure_lookups (face, HB_OT_TAG_GSUB, set, lookup_indexes);
+#endif
hb_map_t *lookup_mapping = hb_map_create ();
hb_map_set (lookup_mapping, 0, 0);
hb_set_t *feature_indices = hb_set_create ();
+#ifdef HB_EXPERIMENTAL_API
hb_ot_layout_closure_features (face, HB_OT_TAG_GSUB, lookup_mapping, feature_indices);
+#endif
hb_set_destroy (lookup_indexes);
hb_set_destroy (feature_indices);
hb_map_destroy (lookup_mapping);
diff --git a/test/api/test-subset-gpos.c b/test/api/test-subset-gpos.c
index 5546bf2..5c2fe2e 100644
--- a/test/api/test-subset-gpos.c
+++ b/test/api/test-subset-gpos.c
@@ -32,6 +32,7 @@
static void
test_subset_gpos_lookup_subtable (void)
{
+#ifdef HB_EXPERIMENTAL_API
hb_face_t *face_pwa = hb_test_open_font_file ("fonts/Roboto-Regular-gpos-.aw.ttf");
hb_face_t *face_wa = hb_test_open_font_file ("fonts/Roboto-Regular-gpos-aw.ttf");
@@ -52,12 +53,14 @@
hb_face_destroy (face_pwa_subset);
hb_face_destroy (face_pwa);
hb_face_destroy (face_wa);
+#endif
}
/* TODO: Once GDEF subsetting is implemented, this test may fail & expected result need update. */
static void
test_subset_gpos_pairpos1_vf (void)
{
+#ifdef HB_EXPERIMENTAL_API
hb_face_t *face_wav = hb_test_open_font_file ("fonts/AdobeVFPrototype.WAV.gpos.otf");
hb_face_t *face_wa = hb_test_open_font_file ("fonts/AdobeVFPrototype.WA.gpos.otf");
@@ -78,6 +81,7 @@
hb_face_destroy (face_wav_subset);
hb_face_destroy (face_wav);
hb_face_destroy (face_wa);
+#endif
}
int
diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources
index 597ab7e..f50e6ae 100644
--- a/test/subset/data/Makefile.sources
+++ b/test/subset/data/Makefile.sources
@@ -4,6 +4,14 @@
tests/cff-full-font.tests \
tests/japanese.tests \
tests/cff-japanese.tests \
+ tests/cmap.tests \
+ tests/cmap14.tests \
+ tests/sbix.tests \
+ tests/colr.tests \
+ tests/cbdt.tests \
+ $(NULL)
+
+DISABLED_TESTS = \
tests/layout.tests \
tests/layout.gpos.tests \
tests/layout.gpos2.tests \
@@ -13,11 +21,6 @@
tests/layout.gsub3.tests \
tests/layout.gsub6.tests \
tests/layout.gdef.tests \
- tests/cmap.tests \
- tests/cmap14.tests \
- tests/sbix.tests \
- tests/colr.tests \
- tests/cbdt.tests \
$(NULL)
XFAIL_TESTS = \
diff --git a/test/subset/meson.build b/test/subset/meson.build
index ef30bd8..35b6c0b 100644
--- a/test/subset/meson.build
+++ b/test/subset/meson.build
@@ -4,15 +4,15 @@
'cff-full-font',
'japanese',
'cff-japanese',
- 'layout',
- 'layout.gpos',
- 'layout.gpos2',
- 'layout.gpos3',
- 'layout.gpos4',
- 'layout.gpos6',
- 'layout.gsub3',
- 'layout.gsub6',
- 'layout.gdef',
+ #'layout',
+ #'layout.gpos',
+ #'layout.gpos2',
+ #'layout.gpos3',
+ #'layout.gpos4',
+ #'layout.gpos6',
+ #'layout.gsub3',
+ #'layout.gsub6',
+ #'layout.gdef',
'cmap',
'cmap14',
'sbix',