diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index bd7b36ec0..9a46f5b0a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,6 +59,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 + uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 with: sarif_file: results.sarif diff --git a/CMakeLists.txt b/CMakeLists.txt index 203f2396c..20ad8e761 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ set (project_headers ${PROJECT_SOURCE_DIR}/src/hb-ot.h ${PROJECT_SOURCE_DIR}/src/hb-paint.h ${PROJECT_SOURCE_DIR}/src/hb-set.h + ${PROJECT_SOURCE_DIR}/src/hb-script-list.h ${PROJECT_SOURCE_DIR}/src/hb-shape-plan.h ${PROJECT_SOURCE_DIR}/src/hb-shape.h ${PROJECT_SOURCE_DIR}/src/hb-style.h diff --git a/NEWS b/NEWS index 28c274b8d..796cfe561 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,17 @@ +Overview of changes leading to 11.1.0 +Wednesdat, April 16, 2025 +==================================== +- Include bidi mirroring variants of the requested codepoints when subsetting. + The new HB_SUBSET_FLAGS_NO_BIDI_CLOSURE can be used to disable this + behaviour. +- Various bug fixes. +- Various build fixes and improvements. +- Various test suite improvements. + +New API: ++HB_SUBSET_FLAGS_NO_BIDI_CLOSURE + + Overview of changes leading to 11.0.1 Friday, April 4, 2025 ==================================== diff --git a/meson.build b/meson.build index b8271b010..4a7c0978d 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('harfbuzz', ['c', 'cpp'], meson_version: '>= 0.60.0', - version: '11.0.1', + version: '11.1.0', default_options: [ 'cpp_eh=none', # Just to support msvc, we are passing -fno-exceptions also anyway # 'cpp_rtti=false', # Do NOT enable, wraps inherit it and ICU needs RTTI @@ -32,11 +32,16 @@ pkgmod = import('pkgconfig') cpp = meson.get_compiler('cpp') null_dep = dependency('', required: false) + +# Includes Microsoft Clang compiler with GNU arguments, see +# https://github.com/harfbuzz/harfbuzz/pull/4394 +cpp_is_microsoft_compiler = host_machine.system() == 'windows' and cpp.get_define('_MSC_FULL_VER') != '' + # Only perform these checks if cpp_std is c++11 as setting -std directly # produces a warning from meson. if get_option('cpp_std') == 'c++11' # Enforce C++14 requirement for MSVC STL - if cpp.get_id() == 'clang' and cpp.get_define('_MSC_FULL_VER') != '' + if cpp.get_id() == 'clang' and cpp_is_microsoft_compiler add_project_arguments('-std=c++14', language: 'cpp') elif cpp.get_id() == 'clang-cl' # Clang-cl produces a warning when using -std=c++14, but not when using /std:c++14 diff --git a/src/OT/Color/COLR/COLR.hh b/src/OT/Color/COLR/COLR.hh index bce07d493..7c8cc79a5 100644 --- a/src/OT/Color/COLR/COLR.hh +++ b/src/OT/Color/COLR/COLR.hh @@ -1604,7 +1604,7 @@ struct ClipBox void closurev1 (hb_colrv1_closure_context_t* c) const { switch (u.format) { - case 2: u.format2.closurev1 (c); + case 2: u.format2.closurev1 (c); return; default:return; } } diff --git a/src/check-symbols.py b/src/check-symbols.py index d0ea303e3..a577bddcc 100755 --- a/src/check-symbols.py +++ b/src/check-symbols.py @@ -17,6 +17,7 @@ IGNORED_SYMBOLS += [ 'rust_eh_personality', '_ZN3std9panicking11EMPTY_PANIC.*', # 'std::panicking::EMPTY_PANIC::.*' '_ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY.*', # 'std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::.*' + '_ZN3std3sys4args4unix3imp15ARGV_INIT_ARRAY.*', # std::sys::args::unix::imp::ARGV_INIT_ARRAY::.* '_ZN17compiler_builtins4math4libm7generic4sqrt9RSQRT_TAB.*', # 'compiler_builtins::math::libm::generic::sqrt::RSQRT_TAB::.*' ] diff --git a/src/fontations/lib.rs b/src/fontations/lib.rs index fc1196a1d..bfcf95f4e 100644 --- a/src/fontations/lib.rs +++ b/src/fontations/lib.rs @@ -969,6 +969,9 @@ extern "C" fn _hb_fontations_paint_glyph( hb_paint_push_font_transform(paint_funcs, paint_data, font); } let _ = color_glyph.paint(location, &mut painter); + unsafe { + hb_paint_pop_transform(paint_funcs, paint_data); + } } extern "C" fn _hb_fontations_glyph_name( diff --git a/src/hb-font.hh b/src/hb-font.hh index 8aee4c12c..7c7aeaf0c 100644 --- a/src/hb-font.hh +++ b/src/hb-font.hh @@ -782,8 +782,8 @@ struct hb_font_t bool y_neg = y_scale < 0; y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) / upem; - x_strength = fabsf (roundf (x_scale * x_embolden)); - y_strength = fabsf (roundf (y_scale * y_embolden)); + x_strength = roundf (abs (x_scale) * x_embolden); + y_strength = roundf (abs (y_scale) * y_embolden); slant_xy = y_scale ? slant * x_scale / y_scale : 0.f; diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 3fdd08e78..4678284e3 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -415,18 +415,18 @@ hb_ot_get_glyph_extents (hb_font_t *font, const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; const hb_ot_face_t *ot_face = ot_font->ot_face; -#ifndef HB_NO_VAR_COMPOSITES - if (ot_face->VARC->get_extents (font, glyph, extents)) return true; -#endif -#ifndef HB_NO_VAR_HVF - if (ot_face->hvgl->get_extents (font, glyph, extents)) return true; -#endif #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) if (ot_face->sbix->get_extents (font, glyph, extents)) return true; if (ot_face->CBDT->get_extents (font, glyph, extents)) return true; #endif #if !defined(HB_NO_COLOR) && !defined(HB_NO_PAINT) if (ot_face->COLR->get_extents (font, glyph, extents)) return true; +#endif +#ifndef HB_NO_VAR_COMPOSITES + if (ot_face->VARC->get_extents (font, glyph, extents)) return true; +#endif +#ifndef HB_NO_VAR_HVF + if (ot_face->hvgl->get_extents (font, glyph, extents)) return true; #endif if (ot_face->glyf->get_extents (font, glyph, extents)) return true; #ifndef HB_NO_OT_FONT_CFF diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index d98ad6012..b0d4412fc 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -182,7 +182,7 @@ struct BaseCoord void collect_variation_indices (hb_set_t& varidx_set /* OUT */) const { switch (u.format) { - case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set); + case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set); return; default:return; } } diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 3c9a0fc5d..83e8a5d74 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -2632,7 +2632,8 @@ struct hb_get_glyph_alternates_dispatch_t : * @alternate_glyphs: (out caller-allocates) (array length=alternate_count): A glyphs buffer. * Alternate glyphs associated with the glyph id. * - * Fetches alternates of a glyph from a given GSUB lookup index. + * Fetches alternates of a glyph from a given GSUB lookup index. Note that for one-to-one GSUB + * glyph substitutions, this function fetches the substituted glyph. * * Return value: Total number of alternates found in the specific lookup index for the given glyph id. * diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 49362fdee..25073d23f 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -29,6 +29,8 @@ #include "hb-map.hh" #include "hb-multimap.hh" #include "hb-set.hh" +#include "hb-subset.h" +#include "hb-unicode.h" #include "hb-ot-cmap-table.hh" #include "hb-ot-glyf-table.hh" @@ -209,15 +211,46 @@ _fill_unicode_and_glyph_map(hb_subset_plan_t *plan, _fill_unicode_and_glyph_map(plan, unicode_iterator, unicode_to_gid_for_iterator, unicode_to_gid_for_iterator); } +/* + * Finds additional unicode codepoints which are reachable from the input unicode set. + * Currently this adds in mirrored variants (needed for bidi) of any input unicodes. + */ +static hb_set_t +_unicode_closure (const hb_set_t* unicodes, bool bidi_closure) { + // TODO: we may want to also consider pulling in reachable unicode composition and decompositions. + // see: https://github.com/harfbuzz/harfbuzz/issues/2283 + hb_set_t out = *unicodes; + if (!bidi_closure) return out; + + if (out.is_inverted()) { + // don't closure inverted sets, they are asking to specifically exclude certain codepoints. + // otherwise everything is already included. + return out; + } + + auto unicode_funcs = hb_unicode_funcs_get_default (); + for (hb_codepoint_t cp : *unicodes) { + hb_codepoint_t mirror = hb_unicode_mirroring(unicode_funcs, cp); + if (unlikely (mirror != cp)) { + out.add(mirror); + } + } + + return out; +} + static void -_populate_unicodes_to_retain (const hb_set_t *unicodes, +_populate_unicodes_to_retain (const hb_set_t *unicodes_in, const hb_set_t *glyphs, hb_subset_plan_t *plan) { + hb_set_t unicodes = _unicode_closure(unicodes_in, + !(plan->flags & HB_SUBSET_FLAGS_NO_BIDI_CLOSURE)); + OT::cmap::accelerator_t cmap (plan->source); unsigned size_threshold = plan->source->get_num_glyphs (); - if (glyphs->is_empty () && unicodes->get_population () < size_threshold) + if (glyphs->is_empty () && unicodes.get_population () < size_threshold) { const hb_map_t* unicode_to_gid = nullptr; @@ -227,9 +260,9 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, // This is approach to collection is faster, but can only be used if glyphs // are not being explicitly added to the subset and the input unicodes set is // not excessively large (eg. an inverted set). - plan->unicode_to_new_gid_list.alloc (unicodes->get_population ()); + plan->unicode_to_new_gid_list.alloc (unicodes.get_population ()); if (!unicode_to_gid) { - _fill_unicode_and_glyph_map(plan, unicodes->iter(), [&] (hb_codepoint_t cp) { + _fill_unicode_and_glyph_map(plan, unicodes.iter(), [&] (hb_codepoint_t cp) { hb_codepoint_t gid; if (!cmap.get_nominal_glyph (cp, &gid)) { return HB_MAP_VALUE_INVALID; @@ -241,7 +274,7 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, // the map. This code is mostly duplicated from above to avoid doing // conditionals on the presence of the unicode_to_gid map each // iteration. - _fill_unicode_and_glyph_map(plan, unicodes->iter(), [&] (hb_codepoint_t cp) { + _fill_unicode_and_glyph_map(plan, unicodes.iter(), [&] (hb_codepoint_t cp) { return unicode_to_gid->get (cp); }); } @@ -258,7 +291,7 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, if (!plan->accelerator) { cmap.collect_mapping (&cmap_unicodes_storage, &unicode_glyphid_map_storage); - plan->unicode_to_new_gid_list.alloc (hb_min(unicodes->get_population () + plan->unicode_to_new_gid_list.alloc (hb_min(unicodes.get_population () + glyphs->get_population (), cmap_unicodes->get_population ())); } else { @@ -267,10 +300,10 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, } if (plan->accelerator && - unicodes->get_population () < cmap_unicodes->get_population () && + unicodes.get_population () < cmap_unicodes->get_population () && glyphs->get_population () < cmap_unicodes->get_population ()) { - plan->codepoint_to_glyph->alloc (unicodes->get_population () + glyphs->get_population ()); + plan->codepoint_to_glyph->alloc (unicodes.get_population () + glyphs->get_population ()); auto &gid_to_unicodes = plan->accelerator->gid_to_unicodes; @@ -285,7 +318,7 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, }); } - _fill_unicode_and_glyph_map(plan, unicodes->iter(), [&] (hb_codepoint_t cp) { + _fill_unicode_and_glyph_map(plan, unicodes.iter(), [&] (hb_codepoint_t cp) { /* Don't double-add entry. */ if (plan->codepoint_to_glyph->has (cp)) return HB_MAP_VALUE_INVALID; @@ -306,7 +339,7 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, { _fill_unicode_and_glyph_map(plan, hb_range(first, last + 1), [&] (hb_codepoint_t cp) { hb_codepoint_t gid = (*unicode_glyphid_map)[cp]; - if (!unicodes->has (cp) && !glyphs->has (gid)) + if (!unicodes.has (cp) && !glyphs->has (gid)) return HB_MAP_VALUE_INVALID; return gid; }, diff --git a/src/hb-subset.h b/src/hb-subset.h index 51bc7e793..374035df3 100644 --- a/src/hb-subset.h +++ b/src/hb-subset.h @@ -71,10 +71,12 @@ typedef struct hb_subset_plan_t hb_subset_plan_t; * in the final subset. * @HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES: If set then the unicode ranges in * OS/2 will not be recalculated. - * @HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE: If set don't perform glyph closure on layout + * @HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE: If set do not perform glyph closure on layout * substitution rules (GSUB). Since: 7.2.0. * @HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS: If set perform IUP delta optimization on the * remaining gvar table's deltas. Since: 8.5.0 + * @HB_SUBSET_FLAGS_NO_BIDI_CLOSURE: If set do not pull mirrored versions of input + * codepoints into the subset. Since: 11.1.0 * @HB_SUBSET_FLAGS_IFTB_REQUIREMENTS: If set enforce requirements on the output subset * to allow it to be used with incremental font transfer IFTB patches. Primarily, * this forces all outline data to use long (32 bit) offsets. Since: EXPERIMENTAL @@ -96,8 +98,9 @@ typedef enum { /*< flags >*/ HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES = 0x00000100u, HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE = 0x00000200u, HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS = 0x00000400u, + HB_SUBSET_FLAGS_NO_BIDI_CLOSURE = 0x00000800u, #ifdef HB_EXPERIMENTAL_API - HB_SUBSET_FLAGS_IFTB_REQUIREMENTS = 0x00000800u, + HB_SUBSET_FLAGS_IFTB_REQUIREMENTS = 0x00001000u, #endif } hb_subset_flags_t; diff --git a/src/hb-version.h b/src/hb-version.h index dbbc1e1a4..885434adc 100644 --- a/src/hb-version.h +++ b/src/hb-version.h @@ -47,20 +47,20 @@ HB_BEGIN_DECLS * * The minor component of the library version available at compile-time. */ -#define HB_VERSION_MINOR 0 +#define HB_VERSION_MINOR 1 /** * HB_VERSION_MICRO: * * The micro component of the library version available at compile-time. */ -#define HB_VERSION_MICRO 1 +#define HB_VERSION_MICRO 0 /** * HB_VERSION_STRING: * * A string literal containing the library version available at compile-time. */ -#define HB_VERSION_STRING "11.0.1" +#define HB_VERSION_STRING "11.1.0" /** * HB_VERSION_ATLEAST: diff --git a/src/hb.hh b/src/hb.hh index 187dbbdb7..ce8d075cd 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -465,7 +465,7 @@ static int HB_UNUSED _hb_errno = 0; # define hb_atexit atexit # else template struct hb_atexit_t { ~hb_atexit_t () { function (); } }; -# define hb_atexit(f) static hb_atexit_t _hb_atexit_##__LINE__; +# define hb_atexit(f) static hb_atexit_t _hb_atexit_##__LINE__ # endif #endif #endif diff --git a/src/meson.build b/src/meson.build index 462ebd6e2..61de41890 100644 --- a/src/meson.build +++ b/src/meson.build @@ -601,7 +601,7 @@ defs_list = [harfbuzz_def] version = '0.@0@.0'.format(hb_version_int) extra_hb_cpp_args = [] -if cpp.get_define('_MSC_FULL_VER') != '' +if cpp_is_microsoft_compiler if get_option('default_library') != 'static' extra_hb_cpp_args += '-DHB_DLL_EXPORT' endif @@ -723,7 +723,7 @@ if get_option('tests').enabled() # TODO: Microsoft LINK gives the following because extern, non dllexport # symbols can only be used when linking against a static library # error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool" - if cpp.get_define('_MSC_FULL_VER') == '' + if not cpp_is_microsoft_compiler noinst_programs = { 'main': 'main.cc', 'test-basics': 'test.cc', @@ -770,7 +770,7 @@ if get_option('tests').enabled() 'test-unicode-ranges': ['test-unicode-ranges.cc'], } foreach name, source : compiled_tests - if cpp.get_define('_MSC_FULL_VER') != '' and source.contains('hb-static.cc') + if cpp_is_microsoft_compiler and source.contains('hb-static.cc') # TODO: Microsoft compilers cannot link tests using hb-static.cc, fix them continue endif @@ -842,15 +842,10 @@ have_gobject = conf.get('HAVE_GOBJECT', 0) == 1 cmake_config = configuration_data() cmake_config_dir = cmake_package_install_dir / 'harfbuzz' -have_fs_relative_to = meson.version().version_compare('>=1.3.0') - -if not have_fs_relative_to - relative_to = find_program('relative_to.py') -endif - -if have_fs_relative_to +if meson.version().version_compare('>=1.3.0') cmake_package_prefix_dir = fs.relative_to(get_option('prefix'), get_option('prefix') / cmake_config_dir) else + relative_to = find_program('relative_to.py') cmake_package_prefix_dir = run_command(relative_to, get_option('prefix'), get_option('prefix') / cmake_config_dir, check: true).stdout().strip() endif @@ -862,7 +857,7 @@ cmake_package_prefix_dir = '${CMAKE_CURRENT_LIST_DIR}/@0@'.format(cmake_package_ cmake_install_includedir = get_option('includedir') if fs.is_absolute(cmake_install_includedir) - if have_fs_relative_to + if meson.version().version_compare('>=1.3.0') cmake_install_includedir = fs.relative_to(cmake_install_includedir, get_option('prefix')) else cmake_install_includedir = run_command(relative_to, cmake_install_includedir, get_option('prefix'), check: true).stdout().strip() @@ -872,7 +867,7 @@ endif cmake_install_libdir = get_option('libdir') if fs.is_absolute(cmake_install_libdir) - if have_fs_relative_to + if meson.version().version_compare('>=1.3.0') cmake_install_libdir = fs.relative_to(cmake_install_libdir, get_option('prefix')) else cmake_install_libdir = run_command(relative_to, cmake_install_libdir, get_option('prefix'), check: true).stdout().strip() @@ -1049,11 +1044,17 @@ if get_option('tests').enabled() env.set('libs', meson.current_build_dir()) # TODO: Merge this with builddir after autotools removal HBSOURCES = [] foreach f : hb_sources + if meson.version().version_compare('>=1.4.0') + f = f.full_path() + endif HBSOURCES += '@0@'.format(f) endforeach env.set('HBSOURCES', ' '.join(HBSOURCES)) HBHEADERS = [] foreach f : hb_headers + if meson.version().version_compare('>=1.4.0') + f = f.full_path() + endif HBHEADERS += '@0@'.format(f) endforeach env.set('HBHEADERS', ' '.join(HBHEADERS)) diff --git a/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3C.ttf b/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3C.ttf new file mode 100644 index 000000000..743de85d5 Binary files /dev/null and b/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3C.ttf differ diff --git a/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3E.ttf b/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3E.ttf new file mode 100644 index 000000000..743de85d5 Binary files /dev/null and b/test/subset/data/expected/bidi/Roboto-Regular.default.61,62,63,3E.ttf differ diff --git a/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3C.ttf b/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3C.ttf new file mode 100644 index 000000000..3586ec85a Binary files /dev/null and b/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3C.ttf differ diff --git a/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3E.ttf b/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3E.ttf new file mode 100644 index 000000000..0810670ef Binary files /dev/null and b/test/subset/data/expected/bidi/Roboto-Regular.no_bidi_closure.61,62,63,3E.ttf differ diff --git a/test/subset/data/profiles/layout-test-retain-gids.txt b/test/subset/data/profiles/layout-test-retain-gids.txt index 63c67eb97..4fe71eb7e 100644 --- a/test/subset/data/profiles/layout-test-retain-gids.txt +++ b/test/subset/data/profiles/layout-test-retain-gids.txt @@ -1,3 +1,4 @@ --layout-features=* --notdef-outline +--no-bidi-closure --retain-gids diff --git a/test/subset/data/profiles/layout-test.txt b/test/subset/data/profiles/layout-test.txt index d98633a00..895f69db5 100644 --- a/test/subset/data/profiles/layout-test.txt +++ b/test/subset/data/profiles/layout-test.txt @@ -1,2 +1,3 @@ --layout-features=* --notdef-outline +--no-bidi-closure diff --git a/test/subset/data/profiles/no_bidi_closure.txt b/test/subset/data/profiles/no_bidi_closure.txt new file mode 100644 index 000000000..31adb7199 --- /dev/null +++ b/test/subset/data/profiles/no_bidi_closure.txt @@ -0,0 +1 @@ +--no-bidi-closure diff --git a/test/subset/data/tests/bidi.tests b/test/subset/data/tests/bidi.tests new file mode 100644 index 000000000..fb5732871 --- /dev/null +++ b/test/subset/data/tests/bidi.tests @@ -0,0 +1,10 @@ +FONTS: +Roboto-Regular.ttf + +PROFILES: +default.txt +no_bidi_closure.txt + +SUBSETS: +abc< +abc> diff --git a/test/subset/meson.build b/test/subset/meson.build index 7037223c7..f87bab543 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -1,5 +1,6 @@ tests = [ 'basics', + 'bidi', 'cmap', 'cmap14', 'preprocess', diff --git a/util/hb-subset.cc b/util/hb-subset.cc index 431edda34..bdb71c332 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -985,6 +985,7 @@ subset_main_t::add_options () {"notdef-outline", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Keep the outline of \'.notdef\' glyph", nullptr}, {"no-prune-unicode-ranges", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Don't change the 'OS/2 ulUnicodeRange*' bits.", nullptr}, {"no-layout-closure", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Don't perform glyph closure for layout substitution (GSUB).", nullptr}, + {"no-bidi-closure", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Don't perform bidi closure (adding mirrored variants) for input codepoints.", nullptr}, {"glyph-names", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Keep PS glyph names in TT-flavored fonts. ", nullptr}, {"passthrough-tables", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &set_flag, "Do not drop tables that the tool does not know how to subset.", nullptr}, {"preprocess-face", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &this->preprocess,