From 4a8a3e12cf5e137a81b78ea1902e2c1cbcee6367 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 May 2025 14:45:42 -0600 Subject: [PATCH 01/17] [ot-layout] Docs Fixes https://github.com/harfbuzz/harfbuzz/issues/5335 --- src/hb-ot-layout.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index e4223ed09..5df277df9 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -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. From 3e93786cc4c57bbf9ddf6de007a82413ae59b734 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 May 2025 14:50:35 -0600 Subject: [PATCH 02/17] [ot-layout] More (nullable) instead of (optional) Honestly I don't know why we should ever use (optional). Looks like (nullable) applies to all (optional) and some more places. https://gi.readthedocs.io/en/latest/annotations/giannotations.html --- src/hb-ot-layout.cc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 5df277df9..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 * @@ -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. From e1dcc454f153fe2c006fc0354ade819770549ea2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 May 2025 16:00:08 -0600 Subject: [PATCH 03/17] [gvar] Use cached scratch in get_extents Makes it alloc-free. 15% faster on benchmark-font glyph_extents RobotoFlex var benchmark. --- src/OT/glyf/glyf.hh | 59 +++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 065bfc7a6..159837c1a 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -446,12 +446,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); @@ -490,30 +494,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; } @@ -531,6 +521,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 From c200418f151cd8021d095766b9d707ae3e351efa Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 22 May 2025 10:56:29 -0300 Subject: [PATCH 04/17] remove hb-ot-shape-closure --- CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a1f1d20..187fe5e15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -843,16 +843,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 +996,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 From 227a5e11ee86f91b383d0f19e61b7d367cfea58c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 May 2025 20:11:08 -0600 Subject: [PATCH 05/17] [VarRegionList] Inline evaluate() cache lookup Seeing 45% speedup in benchmark-font glyph_h_advances benchmark on a mega variable font! --- src/hb-ot-layout-common.hh | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index b920b925c..6edd5cd1b 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 From e69b3c4159383e7cb882f46280d60b6e9a4106df Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 May 2025 20:41:36 -0600 Subject: [PATCH 06/17] [ItemVariationStore] Speed up get_delta Another 15% in the same benchmark. --- src/hb-ot-layout-common.hh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 6edd5cd1b..2df0cc6b4 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2890,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; From cb53f4b5aa145ccd8965faa4b5fb3cbf48120853 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 23 May 2025 17:52:57 +0000 Subject: [PATCH 07/17] [instancer] fix tsb calculation for CFF2 fonts. tsb was being set equal to the y max of each glyph, which is not correct. Instead calculate tsb as vorg.y - ymax. --- src/hb-subset-plan-var.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hb-subset-plan-var.cc b/src/hb-subset-plan-var.cc index c917d8af2..525ff473d 100644 --- a/src/hb-subset-plan-var.cc +++ b/src/hb-subset-plan-var.cc @@ -292,13 +292,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; } From fac64e58389c201c60a24e1a3b7059511ae3e28f Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 23 May 2025 18:15:41 +0000 Subject: [PATCH 08/17] [instancer] add a test which checks calculation of vmtx tsb during CFF2 instancing. --- ...bset.default.5005,5006,5009,500D.wght=300.otf | Bin 0 -> 2124 bytes test/subset/data/fonts/NotoSansJP-VF.subset.otf | Bin 0 -> 4016 bytes .../subset/data/tests/instantiate_cff2_tsb.tests | 14 ++++++++++++++ test/subset/meson.build | 1 + 4 files changed, 15 insertions(+) create mode 100644 test/subset/data/expected/instantiate_cff2_tsb/NotoSansJP-VF.subset.default.5005,5006,5009,500D.wght=300.otf create mode 100644 test/subset/data/fonts/NotoSansJP-VF.subset.otf create mode 100644 test/subset/data/tests/instantiate_cff2_tsb.tests 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 0000000000000000000000000000000000000000..ed63414d383b58d917ebc277581fb12ea3bdffdb GIT binary patch literal 2124 zcma)5dr(wW82|1ryZ3^N66_%`#4VB6D38^U5zRmZMUqXBlmuM?SqFBZWd#*f6mbki zh2`ZdHFQiyk@As<|6n%b%)$vDJ*K86#_HVdT%_;bC9pb``+bl5 zZAMmB28@FmP(#_=loX@g;9mxy@c~fJOf_X>COgvC0&pP!5S*I1B+2^RGPJ1zP=7Ha zGun8px3dTJgQ%~}%u38!f1ukcmK08nksgU_nVHN6f{>X`38k9J!whVvYK>_H2Km_Pf z28e~{Aqu9-cJP8A++1=>dKL&E*8{`D@`+3BzJ_b%*#EN7-($z)0VRSS!qj~V{j#~g``Ig?A3mqS zvuzE87MpEm2rV%?Y!E7Q{i7>#K5}RDc*-5rqdf+10XN!AT9c>ATkfGrg0Otn3>Lxim54nTw@OVV#AOOA@kyS7jJ|B_Q@FJqzc#kJA8l0QyBkx)W27kAV z;YNKqHOA77ynD*C2d_XOtbro1fCJJ;rA1JRdMRXr8EjAvX*i@)Aq!D!P|rpmJHD<# zgbiyj;(W&7o(>6!kUjGiO9k3u64?Nzl>Uq_d5K!8RRLC!*rfGlU zOoU`ef(-Qj@4ON~MrI&(9xO)QB3KJ07|%ZHXBe%>pwx6yi5-KvO~?9-7}SkP1-&b=GY<4JC|Q&viybQPEWno(r85qc z79oRGi4cZam13@T&;WtmZ6XD1 zT#{jGO6#`6)y~>)Z+$^MF3|D96gH7uvb?|aWU=tpX;^RMsH(5o&d z$#Xq}$q6it424}3nfUev-r+Aj#7KrN4{c;LrSB8{;O?NL%qkBl#*(uDQ14z%bV+3HaBkV z>+7Te`>40Te(NHZJ6-&Ge@2|l=a%fcPj*edS4Tb2)n-FiuOjCAQl7J}WmDtU>wTxG z|9NOR4;^2RMcQ0)Vn@E)BbFkfaRLvcN> zm3)1JMyz#plAjqz)7V%#HKnPo{ZLCQi@wg%s5idqgj{Vr@q9NgS*38YO5Agfmwprv5Ej8RpGp?bo@Tn>*19(~ zG;I;+1nPU7&ZmLnX(V6npD(tv#nQn7@j5-qOKt2vVQrUashG#Cy|k4VAGvN57T!z4 zd3Kw5lU(sp4=)`ZT7XhIN*{=`aE7L%)J?O<@yw2-#yp{Cf9<>W8>LqQ>A-GMm2FEX pUoM>A+;Qo|%{Q+FO0Tk?h@|eNpNYZj<6b(%OW%v#|93(F{s7CwPZj_G literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..89fc1f7d8d9a2ac2f74ae51047dcaaff7e61c8f1 GIT binary patch literal 4016 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 z Date: Fri, 23 May 2025 14:31:35 -0600 Subject: [PATCH 09/17] [test] Remove u8 prefix from strings No idea how/why this got in there to begin with. --- test/api/test-shape-plan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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}}; From 1744743a4819914c1f3bad1a239a6ae1ecfc1a7c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 May 2025 19:21:04 -0600 Subject: [PATCH 10/17] [ot-font] Remove comment We do NOT want to pass gvar_cache to VARC, since VARC uses different coordinates for different glyphs, so the cache values will be wrong. --- src/hb-ot-font.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 3224c9570..9cc7d2554 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -557,7 +557,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 // Keep the following in synch with VARC::get_path_at() if (font->face->table.glyf->get_path (font, glyph, draw_session, gvar_cache)) { ret = true; goto done; } From bd6b30b1865cc0afc0d1e743f0eac27c561aa33d Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 20 May 2025 04:03:37 +0300 Subject: [PATCH 11/17] cmake: always set inline hidden flag. This practically reverts commit ac92ed7d6875374451246a2391859fb763329adb: minimum required cmake version is more than new enough. --- CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 187fe5e15..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 From 8e0243c4927d1cf5747d04c1638bad052aa7b0ea Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 May 2025 16:50:40 -0600 Subject: [PATCH 12/17] [ItemVariationStore] Rewrite the main loop Slows down slightly. Going to revert. --- src/hb-ot-layout-common.hh | 65 ++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 2df0cc6b4..e46203aea 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2874,44 +2874,41 @@ struct VarData if (unlikely (inner >= itemCount)) return 0.; - unsigned int count = regionIndices.len; - bool is_long = longWords (); - unsigned word_count = wordCount (); - unsigned int scount = is_long ? count : word_count; - unsigned int lcount = is_long ? word_count : 0; + float delta = 0.f; + unsigned count = regionIndices.len; + unsigned word_count = wordCount (); + bool is_long = longWords (); + unsigned shift = is_long ? 1 : 0; - const HBUINT8 *bytes = get_delta_bytes (); - const HBUINT8 *row = bytes + inner * get_row_size (); + const HBUINT8 *bytes = get_delta_bytes (); + const HBUINT8 *row = bytes + inner * get_row_size (); - float delta = 0.; - unsigned int i = 0; + for (unsigned i = 0; i < count; i++) + { + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); + if (unlikely (scalar)) + { + if (is_long) + { + if (i < word_count) + delta += scalar * *reinterpret_cast(row); + else + delta += scalar * *reinterpret_cast(row); + } + else + { + if (i < word_count) + delta += scalar * *reinterpret_cast(row); + else + delta += scalar * *reinterpret_cast(row); + } + } - const HBINT32 *lcursor = reinterpret_cast (row); - for (; i < lcount; i++) - { - float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); - 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); - 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); - if (scalar) - delta += scalar * *bcursor; - bcursor++; - } + /* Branch-free, yay. */ + row += 1u << (shift + (i < word_count)); + } - return delta; + return delta; } void get_region_scalars (const int *coords, unsigned int coord_count, From 31653e6bc1addb607b928bbba1f57d2783cf7e9f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 May 2025 16:51:41 -0600 Subject: [PATCH 13/17] Revert "[ItemVariationStore] Rewrite the main loop" This reverts commit 57b636fb13c7ef55d6f435b8f560df653f02612e. --- src/hb-ot-layout-common.hh | 65 ++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index e46203aea..2df0cc6b4 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2874,41 +2874,44 @@ struct VarData if (unlikely (inner >= itemCount)) return 0.; - float delta = 0.f; - unsigned count = regionIndices.len; - unsigned word_count = wordCount (); - bool is_long = longWords (); - unsigned shift = is_long ? 1 : 0; + unsigned int count = regionIndices.len; + bool is_long = longWords (); + unsigned word_count = wordCount (); + unsigned int scount = is_long ? count : word_count; + unsigned int lcount = is_long ? word_count : 0; - const HBUINT8 *bytes = get_delta_bytes (); - const HBUINT8 *row = bytes + inner * get_row_size (); + const HBUINT8 *bytes = get_delta_bytes (); + const HBUINT8 *row = bytes + inner * get_row_size (); - for (unsigned i = 0; i < count; i++) - { - float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); - if (unlikely (scalar)) - { - if (is_long) - { - if (i < word_count) - delta += scalar * *reinterpret_cast(row); - else - delta += scalar * *reinterpret_cast(row); - } - else - { - if (i < word_count) - delta += scalar * *reinterpret_cast(row); - else - delta += scalar * *reinterpret_cast(row); - } - } + float delta = 0.; + unsigned int i = 0; - /* Branch-free, yay. */ - row += 1u << (shift + (i < word_count)); - } + const HBINT32 *lcursor = reinterpret_cast (row); + for (; i < lcount; i++) + { + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); + 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); + 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); + if (scalar) + delta += scalar * *bcursor; + bcursor++; + } - return delta; + return delta; } void get_region_scalars (const int *coords, unsigned int coord_count, From ff7c1e483d8745fca71b14b8c7a6cb1b8aa0ba7c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 25 May 2025 14:54:37 -0600 Subject: [PATCH 14/17] [ft] Make it work with FreeType < 2.8 --- src/hb-ft.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index a7b8f12d0..7b8f730b8 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -202,7 +202,10 @@ static void _hb_ft_hb_font_changed (hb_font_t *font, FT_Face ft_face) } } else - FT_Set_Var_Design_Coordinates (ft_face, 0, nullptr); + { + FT_Fixed unused_stack_coord = 0; + FT_Set_Var_Design_Coordinates (ft_face, 0, &unused_stack_coord); + } #endif } From 2cd19d4b45271962cdbef273c1161ab3460883f0 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 26 May 2025 12:53:23 +0300 Subject: [PATCH 15/17] [meson] Fix build with -Dfuzzer_ldflags on meson >= 1.4.0 The failing-alloc.c file is appended to various hb_sources_* as a string, but on >= 1.4.0 we call full_path() on the sources, and this works only with file objects. Fixes https://github.com/harfbuzz/harfbuzz/pull/5340 --- src/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/meson.build b/src/meson.build index cbe5d9e74..0520c820b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -429,6 +429,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') @@ -621,10 +623,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)] From e9276cf83d450e738c27d2e7519a2f0c9c832b13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 10:34:30 +0000 Subject: [PATCH 16/17] Bump setuptools from 80.7.1 to 80.8.0 in /.ci Bumps [setuptools](https://github.com/pypa/setuptools) from 80.7.1 to 80.8.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v80.7.1...v80.8.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 80.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ci/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From df111468b038574a5b526dea34a5238a284eac2e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 May 2025 13:16:18 -0600 Subject: [PATCH 17/17] [ft] Fix crash on some old versions of freetype --- src/hb-ft.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 7b8f730b8..2ad5bbf74 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -201,10 +201,11 @@ static void _hb_ft_hb_font_changed (hb_font_t *font, FT_Face ft_face) hb_free (ft_coords); } } - else + else if (num_coords) { - FT_Fixed unused_stack_coord = 0; - FT_Set_Var_Design_Coordinates (ft_face, 0, &unused_stack_coord); + // 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 }