diff --git a/.circleci/config.yml b/.circleci/config.yml index 603141331..5a714407b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -121,8 +121,6 @@ jobs: - run: HB_TEST_SHAPE_FUZZER_TIMEOUT=3 HB_TEST_SUBSET_FUZZER_TIMEOUT=30 RUN_VALGRIND=1 make check && make -Ctest/api check-valgrind || .ci/fail.sh # informational for now - run: make -Ctest/api check-symbols || true - # enable and test experimental outline drawing APIs - - run: make clean && HB_EXPERIMENTAL_API=1 make -j9 CPPFLAGS="-DHB_EXPERIMENTAL_API" check clang-everything: docker: @@ -236,6 +234,8 @@ jobs: - run: meson build -Damalgam=true && ninja -Cbuild && rm -rf build # test meson's own unity feature also - run: meson build --unity on && ninja -Cbuild && rm -rf build + # test experimental APIs + - run: meson build -Dexperimental-api=true && ninja -Cbuild && rm -rf build crosscompile-notest-djgpp: docker: diff --git a/meson.build b/meson.build index f67ad2d91..016ef89cc 100644 --- a/meson.build +++ b/meson.build @@ -196,6 +196,10 @@ if get_option('icu-builtin') conf.set('HAVE_ICU_BUILTIN', 1) endif +if get_option('experimental-api') + conf.set('HB_EXPERIMENTAL_API', 1) +endif + if freetype_dep.found() conf.set('HAVE_FREETYPE', 1) deps += [freetype_dep] diff --git a/meson_options.txt b/meson_options.txt index 78b7f7ec0..fa72e9d8a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,5 +28,7 @@ option('introspection', type : 'feature', value : 'disabled', yield : true, option('icu-builtin', type: 'boolean', value: false, description: 'Don\'t separate ICU support as harfbuzz-icu module') +option('experimental-api', type: 'boolean', value: false, + description: 'Enable experimental APIs') option('amalgam', type : 'boolean', value : false, description : 'Enable amalgam builds') diff --git a/src/gen-def.py b/src/gen-def.py index b852932f7..37f54bc22 100755 --- a/src/gen-def.py +++ b/src/gen-def.py @@ -14,7 +14,7 @@ for h in header_paths: with io.open (h, encoding='utf-8') as f: headers_content.append (f.read ()) symbols = sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M)) -if not os.environ.get('HB_EXPERIMENTAL_API', ''): +if '--experimental-api' not in sys.argv: # Move these to harfbuzz-sections.txt when got stable experimental_symbols = \ """hb_font_draw_glyph diff --git a/src/main.cc b/src/main.cc index 70c88f8f6..21bf2005d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -26,6 +26,10 @@ * Red Hat Author(s): Behdad Esfahbod */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "hb.h" #include "hb-ot.h" @@ -37,8 +41,7 @@ #define hb_blob_create_from_file(x) hb_blob_get_empty () #endif -#if !defined(HB_NO_COLOR) && !defined(HB_NO_DRAW) -#ifdef HB_EXPERIMENTAL_API +#if !defined(HB_NO_COLOR) && !defined(HB_NO_DRAW) && defined(HB_EXPERIMENTAL_API) static void svg_dump (hb_face_t *face, unsigned face_index) { @@ -329,7 +332,6 @@ dump_glyphs (hb_blob_t *blob, const char *font_name) hb_draw_funcs_destroy (funcs); } #endif -#endif /* Only this part of this mini app uses private API */ #include "hb-static.cc" @@ -504,10 +506,8 @@ main (int argc, char **argv) hb_blob_t *blob = hb_blob_create_from_file (argv[1]); printf ("Opened font file %s: %d bytes long\n", argv[1], hb_blob_get_length (blob)); print_layout_info_using_private_api (blob); -#if !defined(HB_NO_COLOR) && !defined(HB_NO_DRAW) -#ifdef HB_EXPERIMENTAL_API +#if !defined(HB_NO_COLOR) && !defined(HB_NO_DRAW) && defined(HB_EXPERIMENTAL_API) dump_glyphs (blob, argv[1]); -#endif #endif hb_blob_destroy (blob); diff --git a/src/meson.build b/src/meson.build index 8f21be328..1f71e1bfd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -336,8 +336,14 @@ endif # harfbuzz gen_def = find_program('gen-def.py') + +harfbuzz_def_command_args = [gen_def, '@OUTPUT@', '@INPUT@'] +if get_option('experimental-api') + harfbuzz_def_command_args += '--experimental-api' +endif + harfbuzz_def = custom_target('harfbuzz.def', - command: [gen_def, '@OUTPUT@', '@INPUT@'], + command: harfbuzz_def_command_args, input: hb_headers, output: 'harfbuzz.def') diff --git a/test/subset/meson.build b/test/subset/meson.build index 35b6c0b8c..1ac81e88b 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -4,15 +4,15 @@ tests = [ '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', @@ -25,6 +25,11 @@ run_test = find_program('run-tests.py') foreach t : tests fname = '@0@.tests'.format(t) + # layout test are enabled only under experimental API flag for now + if t.contains('layout') and not get_option('experimental-api') + continue + endif + test(t, run_test, args: [ hb_subset,