diff --git a/.ci/requirements.txt b/.ci/requirements.txt index 8d3a2a5a3..c6a49392a 100644 --- a/.ci/requirements.txt +++ b/.ci/requirements.txt @@ -81,7 +81,7 @@ ninja==1.11.1.4 \ # via -r requirements.in # The following packages are considered to be unsafe in a requirements file: -setuptools==80.7.1 \ - --hash=sha256:ca5cc1069b85dc23070a6628e6bcecb3292acac802399c7f8edc0100619f9009 \ - --hash=sha256:f6ffc5f0142b1bd8d0ca94ee91b30c0ca862ffd50826da1ea85258a06fd94552 +setuptools==80.8.0 \ + --hash=sha256:49f7af965996f26d43c8ae34539c8d99c5042fbff34302ea151eaa9c207cd257 \ + --hash=sha256:95a60484590d24103af13b686121328cc2736bee85de8936383111e421b9edc0 # via -r requirements.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a1f1d20..fab2fdb60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project(harfbuzz) message(WARN "HarfBuzz has a Meson port and tries to migrate all the other build systems to it, please consider using it as we might remove our cmake port soon.") +if(POLICY CMP0063) + cmake_policy(SET CMP0063 NEW) +endif() + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -490,6 +494,7 @@ target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) target_include_directories(harfbuzz PUBLIC "$" "$") +set_target_properties(harfbuzz PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) if (HB_HAVE_FREETYPE AND TARGET freetype) target_link_libraries(harfbuzz freetype) endif () @@ -500,10 +505,9 @@ if (HB_HAVE_ICU) add_library(harfbuzz-icu ${PROJECT_SOURCE_DIR}/src/hb-icu.cc ${PROJECT_SOURCE_DIR}/src/hb-icu.h) add_dependencies(harfbuzz-icu harfbuzz) target_link_libraries(harfbuzz-icu harfbuzz ${THIRD_PARTY_LIBS}) + set_target_properties(harfbuzz-icu PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) if (BUILD_SHARED_LIBS) - set_target_properties(harfbuzz harfbuzz-icu PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) - if (BUILD_FRAMEWORK) set_target_properties(harfbuzz harfbuzz-icu PROPERTIES FRAMEWORK TRUE @@ -528,10 +532,9 @@ if (HB_BUILD_SUBSET) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-subset.h ${PROJECT_SOURCE_DIR}/src/hb-subset-serialize.h) add_dependencies(harfbuzz-subset harfbuzz) target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) + set_target_properties(harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) if (BUILD_SHARED_LIBS) - set_target_properties(harfbuzz harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) - if (BUILD_FRAMEWORK) set_target_properties(harfbuzz harfbuzz-subset PROPERTIES FRAMEWORK TRUE @@ -593,10 +596,9 @@ if (HB_HAVE_GOBJECT) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src) add_dependencies(harfbuzz-gobject harfbuzz) target_link_libraries(harfbuzz-gobject harfbuzz ${GOBJECT_LIBRARIES} ${THIRD_PARTY_LIBS}) + set_target_properties(harfbuzz-gobject PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) if (BUILD_SHARED_LIBS) - set_target_properties(harfbuzz harfbuzz-gobject PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) - if (BUILD_FRAMEWORK) set_target_properties(harfbuzz-gobject PROPERTIES FRAMEWORK TRUE @@ -620,10 +622,9 @@ if (HB_HAVE_CAIRO) add_library(harfbuzz-cairo ${PROJECT_SOURCE_DIR}/src/hb-cairo.cc ${PROJECT_SOURCE_DIR}/src/hb-static.cc ${PROJECT_SOURCE_DIR}/src/hb-cairo.h) add_dependencies(harfbuzz-cairo harfbuzz) target_link_libraries(harfbuzz-cairo harfbuzz ${THIRD_PARTY_LIBS}) + set_target_properties(harfbuzz-cairo PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) if (BUILD_SHARED_LIBS) - set_target_properties(harfbuzz-cairo PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) - if (BUILD_FRAMEWORK) set_target_properties(harfbuzz-cairo PROPERTIES FRAMEWORK TRUE @@ -843,16 +844,6 @@ if (HB_BUILD_UTILS) ) target_link_libraries(hb-subset harfbuzz harfbuzz-subset) - add_executable(hb-ot-shape-closure - ${PROJECT_SOURCE_DIR}/util/face-options.hh - ${PROJECT_SOURCE_DIR}/util/font-options.hh - ${PROJECT_SOURCE_DIR}/util/hb-ot-shape-closure.cc - ${PROJECT_SOURCE_DIR}/util/main-font-text.hh - ${PROJECT_SOURCE_DIR}/util/options.hh - ${PROJECT_SOURCE_DIR}/util/text-options.hh - ) - target_link_libraries(hb-ot-shape-closure harfbuzz) - if (HB_HAVE_GOBJECT) add_executable(hb-info ${PROJECT_SOURCE_DIR}/util/batch.hh @@ -1006,9 +997,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) ) endif() - install(TARGETS hb-ot-shape-closure - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) endif () if (HB_HAVE_GOBJECT) install(TARGETS harfbuzz-gobject diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 2d9e9a660..77a60ca28 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -447,12 +447,16 @@ struct glyf_accelerator_t #ifndef HB_NO_VAR if (coords) { - hb_glyf_scratch_t scratch; - return get_points (font, - gid, - points_aggregator_t (font, extents, nullptr, true), - coords, - scratch); + hb_glyf_scratch_t *scratch = acquire_scratch (); + if (unlikely (!scratch)) + return false; + bool ret = get_points (font, + gid, + points_aggregator_t (font, extents, nullptr, true), + coords, + *scratch); + release_scratch (scratch); + return ret; } #endif return glyph_for_gid (gid).get_extents_without_var_scaled (font, *this, extents); @@ -491,30 +495,16 @@ struct glyf_accelerator_t { if (!has_data ()) return false; - hb_glyf_scratch_t *scratch; - - // Borrow the cached strach buffer. - { - scratch = cached_scratch.get_acquire (); - if (!scratch || unlikely (!cached_scratch.cmpexch (scratch, nullptr))) - { - scratch = (hb_glyf_scratch_t *) hb_calloc (1, sizeof (hb_glyf_scratch_t)); - if (unlikely (!scratch)) - return true; - } - } + hb_glyf_scratch_t *scratch = acquire_scratch (); + if (unlikely (!scratch)) + return true; bool ret = get_points (font, gid, glyf_impl::path_builder_t (font, draw_session), hb_array (font->coords, font->num_coords), *scratch, gvar_cache); - // Put it back. - if (!cached_scratch.cmpexch (nullptr, scratch)) - { - scratch->~hb_glyf_scratch_t (); - hb_free (scratch); - } + release_scratch (scratch); return ret; } @@ -532,6 +522,27 @@ struct glyf_accelerator_t gvar_cache); } + + hb_glyf_scratch_t *acquire_scratch () const + { + hb_glyf_scratch_t *scratch = cached_scratch.get_acquire (); + if (!scratch || unlikely (!cached_scratch.cmpexch (scratch, nullptr))) + { + scratch = (hb_glyf_scratch_t *) hb_calloc (1, sizeof (hb_glyf_scratch_t)); + if (unlikely (!scratch)) + return nullptr; + } + return scratch; + } + void release_scratch (hb_glyf_scratch_t *scratch) const + { + if (!cached_scratch.cmpexch (nullptr, scratch)) + { + scratch->~hb_glyf_scratch_t (); + hb_free (scratch); + } + } + #ifndef HB_NO_VAR const gvar_accelerator_t *gvar; #ifndef HB_NO_BEYOND_64K diff --git a/src/hb-ft.cc b/src/hb-ft.cc index a58bf1952..15a87c264 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -201,8 +201,12 @@ static void _hb_ft_hb_font_changed (hb_font_t *font, FT_Face ft_face) hb_free (ft_coords); } } - else + else if (font->num_coords) + { + // Some old versions of FreeType crash if we + // call this function on non-variable fonts. FT_Set_Var_Design_Coordinates (ft_face, 0, nullptr); + } #endif } diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 8a1c08839..1a81a853a 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -563,7 +563,7 @@ hb_ot_draw_glyph_or_fail (hb_font_t *font, } #ifndef HB_NO_VAR_COMPOSITES - if (font->face->table.VARC->get_path (font, glyph, draw_session/*, gvar_cache*/)) { ret = true; goto done; } + if (font->face->table.VARC->get_path (font, glyph, draw_session)) { ret = true; goto done; } #endif #ifndef HB_NO_VAR_HVF if (!font->face->table.hvgl->get_path (font, glyph, draw_session)) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 765ea26f2..26bf84b68 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2629,19 +2629,12 @@ struct hb_scalar_cache_t struct VarRegionList { - float evaluate (unsigned int region_index, - const int *coords, unsigned int coord_len, - hb_scalar_cache_t *cache = nullptr) const + private: + float evaluate_impl (unsigned int region_index, + const int *coords, unsigned int coord_len) const { - if (unlikely (region_index >= regionCount)) - return 0.; - - float v = 1.; - - if (cache && cache->get (region_index, &v)) - return v; - const VarRegionAxis *axes = axesZ.arrayZ + (region_index * axisCount); + float v = 1.f; unsigned int count = axisCount; for (unsigned int i = 0; i < count; i++) @@ -2656,6 +2649,24 @@ struct VarRegionList v *= factor; } + return v; + } + + public: + HB_ALWAYS_INLINE + float evaluate (unsigned int region_index, + const int *coords, unsigned int coord_len, + hb_scalar_cache_t *cache = nullptr) const + { + if (unlikely (region_index >= regionCount)) + return 0.; + + float v; + if (cache && cache->get (region_index, &v)) + return v; + + v = evaluate_impl (region_index, coords, coord_len); + if (cache) cache->set (region_index, v); return v; @@ -2800,6 +2811,7 @@ struct SparseVariationRegion : Array16Of struct SparseVarRegionList { + HB_ALWAYS_INLINE float evaluate (unsigned int region_index, const int *coords, unsigned int coord_len, hb_scalar_cache_t *cache = nullptr) const @@ -2878,19 +2890,25 @@ struct VarData for (; i < lcount; i++) { float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); - delta += scalar * *lcursor++; + if (scalar) + delta += scalar * *lcursor; + lcursor++; } const HBINT16 *scursor = reinterpret_cast (lcursor); for (; i < scount; i++) { float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); - delta += scalar * *scursor++; + if (scalar) + delta += scalar * *scursor; + scursor++; } const HBINT8 *bcursor = reinterpret_cast (scursor); for (; i < count; i++) { float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); - delta += scalar * *bcursor++; + if (scalar) + delta += scalar * *bcursor; + bcursor++; } return delta; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index e4223ed09..51572ce4b 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -343,7 +343,7 @@ hb_ot_layout_get_glyphs_in_class (hb_face_t *face, * @face: The #hb_face_t to work on * @glyph: The #hb_codepoint_t code point to query * @start_offset: offset of the first attachment point to retrieve - * @point_count: (inout) (optional): Input = the maximum number of attachment points to return; + * @point_count: (inout) (nullable): Input = the maximum number of attachment points to return; * Output = the actual number of attachment points returned (may be zero) * @point_array: (out) (array length=point_count): The array of attachment points found for the query * @@ -373,7 +373,7 @@ hb_ot_layout_get_attach_points (hb_face_t *face, * @direction: The #hb_direction_t text direction to use * @glyph: The #hb_codepoint_t code point to query * @start_offset: offset of the first caret position to retrieve - * @caret_count: (inout) (optional): Input = the maximum number of caret positions to return; + * @caret_count: (inout) (nullable): Input = the maximum number of caret positions to return; * Output = the actual number of caret positions returned (may be zero) * @caret_array: (out) (array length=caret_count): The array of caret positions found for the query * @@ -444,7 +444,7 @@ get_gsubgpos_table (hb_face_t *face, * @face: #hb_face_t to work upon * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @start_offset: offset of the first script tag to retrieve - * @script_count: (inout) (optional): Input = the maximum number of script tags to return; + * @script_count: (inout) (nullable): Input = the maximum number of script tags to return; * Output = the actual number of script tags returned (may be zero) * @script_tags: (out) (array length=script_count): The array of #hb_tag_t script tags found for the query * @@ -541,8 +541,8 @@ hb_ot_layout_table_choose_script (hb_face_t *face, * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @script_count: Number of script tags in the array * @script_tags: Array of #hb_tag_t script tags - * @script_index: (out) (optional): The index of the requested script - * @chosen_script: (out) (optional): #hb_tag_t of the requested script + * @script_index: (out) (nullable): The index of the requested script + * @chosen_script: (out) (nullable): #hb_tag_t of the requested script * * Selects an OpenType script for @table_tag from the @script_tags array. * @@ -613,7 +613,7 @@ hb_ot_layout_table_select_script (hb_face_t *face, * @face: #hb_face_t to work upon * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @start_offset: offset of the first feature tag to retrieve - * @feature_count: (inout) (optional): Input = the maximum number of feature tags to return; + * @feature_count: (inout) (nullable): Input = the maximum number of feature tags to return; * Output = the actual number of feature tags returned (may be zero) * @feature_tags: (out) (array length=feature_count): Array of feature tags found in the table * @@ -683,7 +683,7 @@ hb_ot_layout_table_find_feature (hb_face_t *face, * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @script_index: The index of the requested script tag * @start_offset: offset of the first language tag to retrieve - * @language_count: (inout) (optional): Input = the maximum number of language tags to return; + * @language_count: (inout) (nullable): Input = the maximum number of language tags to return; * Output = the actual number of language tags returned (may be zero) * @language_tags: (out) (array length=language_count): Array of language tags found in the table * @@ -911,7 +911,7 @@ hb_ot_layout_language_get_required_feature (hb_face_t *face, * @script_index: The index of the requested script tag * @language_index: The index of the requested language tag * @start_offset: offset of the first feature tag to retrieve - * @feature_count: (inout) (optional): Input = the maximum number of feature tags to return; + * @feature_count: (inout) (nullable): Input = the maximum number of feature tags to return; * Output: the actual number of feature tags returned (may be zero) * @feature_indexes: (out) (array length=feature_count): The array of feature indexes found for the query * @@ -947,7 +947,7 @@ hb_ot_layout_language_get_feature_indexes (hb_face_t *face, * @script_index: The index of the requested script tag * @language_index: The index of the requested language tag * @start_offset: offset of the first feature tag to retrieve - * @feature_count: (inout) (optional): Input = the maximum number of feature tags to return; + * @feature_count: (inout) (nullable): Input = the maximum number of feature tags to return; * Output = the actual number of feature tags returned (may be zero) * @feature_tags: (out) (array length=feature_count): The array of #hb_tag_t feature tags found for the query * @@ -1035,7 +1035,7 @@ hb_ot_layout_language_find_feature (hb_face_t *face, * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @feature_index: The index of the requested feature * @start_offset: offset of the first lookup to retrieve - * @lookup_count: (inout) (optional): Input = the maximum number of lookups to return; + * @lookup_count: (inout) (nullable): Input = the maximum number of lookups to return; * Output = the actual number of lookups returned (may be zero) * @lookup_indexes: (out) (array length=lookup_count): The array of lookup indexes found for the query * @@ -1386,10 +1386,10 @@ hb_ot_layout_collect_lookups (hb_face_t *face, * @face: #hb_face_t to work upon * @table_tag: #HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS * @lookup_index: The index of the feature lookup to query - * @glyphs_before: (out): Array of glyphs preceding the substitution range - * @glyphs_input: (out): Array of input glyphs that would be substituted by the lookup - * @glyphs_after: (out): Array of glyphs following the substitution range - * @glyphs_output: (out): Array of glyphs that would be the substituted output of the lookup + * @glyphs_before: (out) (nullable): Array of glyphs preceding the substitution range + * @glyphs_input: (out) (nullable): Array of input glyphs that would be substituted by the lookup + * @glyphs_after: (out) (nullable): Array of glyphs following the substitution range + * @glyphs_output: (out) (nullable): Array of glyphs that would be the substituted output of the lookup * * Fetches a list of all glyphs affected by the specified lookup in the * specified face's GSUB table or GPOS table. @@ -1473,7 +1473,7 @@ hb_ot_layout_table_find_feature_variations (hb_face_t *face, * @feature_index: The index of the feature to query * @variations_index: The index of the feature variation to query * @start_offset: offset of the first lookup to retrieve - * @lookup_count: (inout) (optional): Input = the maximum number of lookups to return; + * @lookup_count: (inout) (nullable): Input = the maximum number of lookups to return; * Output = the actual number of lookups returned (may be zero) * @lookup_indexes: (out) (array length=lookup_count): The array of lookups found for the query * @@ -1777,15 +1777,15 @@ hb_ot_layout_get_size_params (hb_face_t *face, * @face: #hb_face_t to work upon * @table_tag: table tag to query, "GSUB" or "GPOS". * @feature_index: index of feature to query. - * @label_id: (out) (optional): The ‘name’ table name ID that specifies a string - * for a user-interface label for this feature. (May be NULL.) - * @tooltip_id: (out) (optional): The ‘name’ table name ID that specifies a string + * @label_id: (out) (nullable): The ‘name’ table name ID that specifies a string + * for a user-interface label for this feature. + * @tooltip_id: (out) (nullable): The ‘name’ table name ID that specifies a string * that an application can use for tooltip text for this - * feature. (May be NULL.) - * @sample_id: (out) (optional): The ‘name’ table name ID that specifies sample text - * that illustrates the effect of this feature. (May be NULL.) - * @num_named_parameters: (out) (optional): Number of named parameters. (May be zero.) - * @first_param_id: (out) (optional): The first ‘name’ table name ID used to specify + * feature. + * @sample_id: (out) (nullable): The ‘name’ table name ID that specifies sample text + * that illustrates the effect of this feature. + * @num_named_parameters: (out) (nullable): Number of named parameters. + * @first_param_id: (out) (nullable): The first ‘name’ table name ID used to specify * strings for user-interface labels for the feature * parameters. (Must be zero if numParameters is zero.) * @@ -1852,7 +1852,7 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face, * @table_tag: table tag to query, "GSUB" or "GPOS". * @feature_index: index of feature to query. * @start_offset: offset of the first character to retrieve - * @char_count: (inout) (optional): Input = the maximum number of characters to return; + * @char_count: (inout) (nullable): Input = the maximum number of characters to return; * Output = the actual number of characters returned (may be zero) * @characters: (out caller-allocates) (array length=char_count): A buffer pointer. * The Unicode codepoints of the characters for which this feature provides @@ -2627,7 +2627,7 @@ struct hb_get_glyph_alternates_dispatch_t : * @lookup_index: index of the feature lookup to query. * @glyph: a glyph id. * @start_offset: starting offset. - * @alternate_count: (inout) (optional): Input = the maximum number of alternate glyphs to return; + * @alternate_count: (inout) (nullable): Input = the maximum number of alternate glyphs to return; * Output = the actual number of alternate glyphs returned (may be zero). * @alternate_glyphs: (out caller-allocates) (array length=alternate_count): A glyphs buffer. * Alternate glyphs associated with the glyph id. diff --git a/src/hb-subset-plan-var.cc b/src/hb-subset-plan-var.cc index 616aa3547..37b78502b 100644 --- a/src/hb-subset-plan-var.cc +++ b/src/hb-subset-plan-var.cc @@ -310,13 +310,18 @@ update_instance_metrics_map_from_cff2 (hb_subset_plan_t *plan) if (_vmtx.var_table.get_length ()) vert_aw += (int) roundf (_vmtx.var_table->get_advance_delta_unscaled (old_gid, font->coords, font->num_coords, vvar_store_cache)); - - int tsb = extents.y_bearing; - if (!has_bounds_info) + hb_position_t vorg_x = 0; + hb_position_t vorg_y = 0; + int tsb = 0; + if (has_bounds_info && + hb_font_get_glyph_v_origin (font, old_gid, &vorg_x, &vorg_y)) { + tsb = vorg_y - extents.y_bearing; + } else { if (!_vmtx.get_leading_bearing_without_var_unscaled (old_gid, &tsb)) continue; } + plan->vmtx_map.set (new_gid, hb_pair ((unsigned) vert_aw, tsb)); plan->bounds_height_vec[new_gid] = extents.height; } diff --git a/src/meson.build b/src/meson.build index 65312479a..9bd7f6865 100644 --- a/src/meson.build +++ b/src/meson.build @@ -431,6 +431,8 @@ hb_gobject_headers = files( 'hb-gobject-structs.h', ) +hb_failing_alloc_sources = files('failing-alloc.c') + ragel = find_program('ragel', version: '6.10', required: false) has_ragel = ragel.found() if not has_ragel and get_option('ragel_subproject') @@ -623,10 +625,10 @@ endif if get_option('fuzzer_ldflags') != '' extra_hb_cpp_args += ['-DHB_CUSTOM_MALLOC'] - hb_sources += 'failing-alloc.c' - hb_subset_sources += 'failing-alloc.c' - hb_icu_sources += 'failing-alloc.c' - hb_gobject_sources += 'failing-alloc.c' + hb_sources += hb_failing_alloc_sources + hb_subset_sources += hb_failing_alloc_sources + hb_icu_sources += hb_failing_alloc_sources + hb_gobject_sources += hb_failing_alloc_sources endif darwin_versions = [hb_version_int, '@0@.0.0'.format(hb_version_int)] diff --git a/test/api/test-shape-plan.c b/test/api/test-shape-plan.c index 8d4d5c7d5..977c5c741 100644 --- a/test/api/test-shape-plan.c +++ b/test/api/test-shape-plan.c @@ -41,7 +41,7 @@ test_ot_shape_plan_get_feature_tags_rtl (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8"()", -1, 0, -1); + hb_buffer_add_utf8 (buffer, "()", -1, 0, -1); hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, &props, NULL, 0, NULL); hb_bool_t ret = hb_shape_plan_execute (shape_plan, font, buffer, NULL, 0); @@ -90,7 +90,7 @@ test_ot_shape_plan_get_feature_tags_ltr (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, &props, NULL, 0, NULL); hb_bool_t ret = hb_shape_plan_execute (shape_plan, font, buffer, NULL, 0); @@ -132,7 +132,7 @@ test_ot_shape_plan_get_feature_tags_ttb (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, &props, NULL, 0, NULL); hb_bool_t ret = hb_shape_plan_execute (shape_plan, font, buffer, NULL, 0); @@ -168,7 +168,7 @@ test_ot_shape_plan_get_feature_tags_userfeatures_enable (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_feature_t user_features[1] = {{HB_TAG ('s', 's', '0', '1'), 1, 0, 1}}; @@ -209,7 +209,7 @@ test_ot_shape_plan_get_feature_tags_userfeatures_disable (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_feature_t user_features[1] = {{HB_TAG ('k', 'e', 'r', 'n'), 0, 0, HB_FEATURE_GLOBAL_END}}; @@ -250,7 +250,7 @@ test_ot_shape_plan_get_feature_tags_userfeatures_disablepartial (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_feature_t user_features[1] = {{HB_TAG ('k', 'e', 'r', 'n'), 0, 0, 1}}; @@ -291,7 +291,7 @@ test_ot_shape_plan_get_feature_tags_userfeatures_disablenondeafult (void) hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_set_segment_properties (buffer, &props); - hb_buffer_add_utf8 (buffer, u8" ", -1, 0, -1); + hb_buffer_add_utf8 (buffer, " ", -1, 0, -1); hb_feature_t user_features[1] = {{HB_TAG ('s', 's', '0', '1'), 0, 0, HB_FEATURE_GLOBAL_END}}; diff --git a/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf b/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf new file mode 100644 index 000000000..ed63414d3 Binary files /dev/null and b/test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf differ diff --git a/test/subset/data/fonts/NotoSansJP-VF.subset.otf b/test/subset/data/fonts/NotoSansJP-VF.subset.otf new file mode 100644 index 000000000..89fc1f7d8 Binary files /dev/null and b/test/subset/data/fonts/NotoSansJP-VF.subset.otf differ diff --git a/test/subset/data/tests/instantiate_cff2_tsb.tests b/test/subset/data/tests/instantiate_cff2_tsb.tests new file mode 100644 index 000000000..6dbe6c801 --- /dev/null +++ b/test/subset/data/tests/instantiate_cff2_tsb.tests @@ -0,0 +1,14 @@ +FONTS: +NotoSansJP-VF.subset.otf + +PROFILES: +default.txt + +SUBSETS: +U+5005,U+5006,U+5009,U+500D + +INSTANCES: +wght=300 + +OPTIONS: +no_fonttools diff --git a/test/subset/meson.build b/test/subset/meson.build index 4c841f0e9..5c88e16ce 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -61,6 +61,7 @@ tests = [ 'instantiate_colrv1', 'instantiate_glyf', 'instantiate_cff2', + 'instantiate_cff2_tsb', 'full_instance', 'instance_feature_variations', 'instance_no_double_free',