From 37627c67566a6bd9fa5ba5825f5786db8f9fdf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Fri, 13 Jun 2025 14:52:04 +0200 Subject: [PATCH 01/12] [docs] Specify the online location of the documentation Move the releaseinfo under the bookinfo as it is what gtk-doc expects. This specifically allows the online location to also be exported into the devhelp2 file. --- docs/harfbuzz-docs.xml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/harfbuzz-docs.xml b/docs/harfbuzz-docs.xml index 76c3b49d1..8616c5393 100644 --- a/docs/harfbuzz-docs.xml +++ b/docs/harfbuzz-docs.xml @@ -24,6 +24,11 @@ release tarballs. + + This document is for HarfBuzz &version;. + The latest version of this documentation can be found on-line at + https://harfbuzz.github.io. + @@ -42,14 +47,6 @@ - - - This document is for HarfBuzz &version;. - - - - Reference manual Core API From e970f7028ccd785d7f35996348a478f71dea7963 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 13 Jun 2025 17:51:24 -0600 Subject: [PATCH 02/12] [harfruzz] Round towards negative infinity --- src/rust/shape.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rust/shape.rs b/src/rust/shape.rs index 22edde8bf..a2fbf0f6c 100644 --- a/src/rust/shape.rs +++ b/src/rust/shape.rs @@ -293,10 +293,10 @@ pub unsafe extern "C" fn _hb_harfrust_shape_rs( if hr_info.safe_to_insert_tatweel() { info.mask |= hb_glyph_flags_t_HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL; } - pos.x_advance = (hr_pos.x_advance as f32 * x_scale).round() as hb_position_t; - pos.y_advance = (hr_pos.y_advance as f32 * y_scale).round() as hb_position_t; - pos.x_offset = (hr_pos.x_offset as f32 * x_scale).round() as hb_position_t; - pos.y_offset = (hr_pos.y_offset as f32 * y_scale).round() as hb_position_t; + pos.x_advance = (hr_pos.x_advance as f32 * x_scale + 0.5).floor() as hb_position_t; + pos.y_advance = (hr_pos.y_advance as f32 * y_scale + 0.5).floor() as hb_position_t; + pos.x_offset = (hr_pos.x_offset as f32 * x_scale + 0.5).floor() as hb_position_t; + pos.y_offset = (hr_pos.y_offset as f32 * y_scale + 0.5).floor() as hb_position_t; } true as hb_bool_t From 6eb4ed6aee96a2e373c86286560d899f9963e977 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 14 Jun 2025 09:23:41 -0600 Subject: [PATCH 03/12] [meson] Disable some tests under -Dutilities=disabled Fixes https://github.com/harfbuzz/harfbuzz/issues/5365 --- meson.build | 3 ++- test/meson.build | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 6af999ff8..b95506445 100644 --- a/meson.build +++ b/meson.build @@ -495,7 +495,8 @@ build_summary = { 'HarfRust': conf.get('HAVE_HARFRUST', 0) == 1, }, 'Other features': - {'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1, + {'Utilities': not get_option('utilities').disabled(), + 'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1, 'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1, 'Cairo integration': conf.get('HAVE_CAIRO', 0) == 1, 'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1, diff --git a/test/meson.build b/test/meson.build index 363971dba..801be8565 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,5 +1,7 @@ +subdir('api') subdir('fuzzing') subdir('threads') +if not get_option('utilities').disabled() subdir('subset') subdir('shape') -subdir('api') +endif From 7278f8a20e799bf5987be482b2a5e1543594fb62 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 14 Jun 2025 11:02:37 -0600 Subject: [PATCH 04/12] [test/shape] Clean up meson Fixes https://github.com/harfbuzz/harfbuzz/issues/5366 --- test/shape/meson.build | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/shape/meson.build b/test/shape/meson.build index 80526b057..4407f54ef 100644 --- a/test/shape/meson.build +++ b/test/shape/meson.build @@ -5,13 +5,6 @@ subdir('data/text-rendering-tests') # text_rendering_tests shape_run_tests_py = find_program('run-tests.py') -env = environment() -env.set('HAVE_FREETYPE', '@0@'.format(conf.get('HAVE_FREETYPE', 0))) -env.set('HAVE_FONTATIONS', '@0@'.format(conf.get('HAVE_FONTATIONS', 0))) -env.set('HAVE_CORETEXT', '@0@'.format(conf.get('HAVE_CORETEXT', 0))) -env.set('HAVE_DIRECTWRITE', '@0@'.format(conf.get('HAVE_DIRECTWRITE', 0))) -env.set('HAVE_UNISCRIBE', '@0@'.format(conf.get('HAVE_UNISCRIBE', 0))) - sets = ['in-house', 'aots', 'text-rendering-tests'] foreach set : sets # in-house -> in_house_tests, aots -> aots_tests, text-rendering-tests -> text_rendering_tests @@ -29,7 +22,6 @@ foreach set : sets ], protocol: 'tap', #verbose: true, - env: env, workdir: meson.current_build_dir() / '..' / '..', suite: ['shape', set], ) From aeee9d572954f3fabd3de301767ef6ab8626b4c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 10:54:36 +0000 Subject: [PATCH 05/12] Bump github/codeql-action from 3.28.19 to 3.29.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.19 to 3.29.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/fca7ace96b7d713c7035871441bd52efbe39e27e...ce28f5bb42b7a9f2c824e633a3f6ee835bab6858) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 299dddf65..22ce68efc 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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 + uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 with: sarif_file: results.sarif From 567a0307fa65db03d51a3bcf19d995e57ffc1d24 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 13 Jun 2025 10:39:37 +0200 Subject: [PATCH 06/12] dwrite: Implement hb_face_reference_blob() --- src/hb-directwrite.cc | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index 9c4bab95d..6e2bd914b 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -161,6 +161,58 @@ _hb_directwrite_table_data_release (void *data) hb_free (context); } +static hb_blob_t * +_hb_directwrite_get_file_blob (IDWriteFontFace *dw_face) +{ + UINT32 file_count; + if (FAILED (dw_face->GetFiles(&file_count, NULL))) + return nullptr; + + IDWriteFontFile **files = new IDWriteFontFile*[file_count]; + if (FAILED (dw_face->GetFiles(&file_count, files))) + { + delete [] files; + return nullptr; + } + + hb_blob_t *blob = nullptr; + for (UINT32 i = 0; i < file_count; i++) + { + LPCVOID reference_key; + UINT32 reference_key_size; + if (FAILED (files[i]->GetReferenceKey(&reference_key, &reference_key_size))) + continue; + + IDWriteFontFileLoader *loader; + if (FAILED (files[i]->GetLoader(&loader))) + continue; + + IDWriteFontFileStream *stream; + if (FAILED (loader->CreateStreamFromKey (reference_key, reference_key_size, &stream))) + { + loader->Release (); + continue; + } + + UINT64 file_size; + const void *fragment; + void *context; + if (FAILED (stream->GetFileSize(&file_size)) || + FAILED (stream->ReadFileFragment (&fragment, 0, file_size, &context))) + { + loader->Release (); + continue; + } + blob = hb_blob_create ((const char *) fragment, file_size, HB_MEMORY_MODE_DUPLICATE, NULL, NULL); + stream->ReleaseFileFragment (context); + loader->Release (); + break; + } + + delete [] files; + return blob; +} + static hb_blob_t * _hb_directwrite_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) { @@ -169,6 +221,9 @@ _hb_directwrite_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void * uint32_t length; void *table_context; BOOL exists; + if (tag == HB_TAG_NONE) + return _hb_directwrite_get_file_blob (dw_face); + if (FAILED (dw_face->TryGetFontTable (hb_uint32_swap (tag), &data, &length, &table_context, &exists))) return nullptr; From 48bc5a17cd5755b3654541d8c7e071cd7a670a5a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 24 Jun 2025 23:02:00 -0600 Subject: [PATCH 07/12] [face-builder] Remove a redundant check Fixes https://github.com/harfbuzz/harfbuzz/issues/5371 --- src/hb-face-builder.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hb-face-builder.cc b/src/hb-face-builder.cc index beea89ed2..c3ddcd856 100644 --- a/src/hb-face-builder.cc +++ b/src/hb-face-builder.cc @@ -169,8 +169,7 @@ _hb_face_builder_get_table_tags (const hb_face_t *face HB_UNUSED, if (unlikely (start_offset >= population)) { - if (table_count) - *table_count = 0; + *table_count = 0; return population; } From 826b7c132b708e0fd205d31009c0df8576220440 Mon Sep 17 00:00:00 2001 From: TN-mo Date: Sat, 28 Jun 2025 05:55:05 +0800 Subject: [PATCH 08/12] fix "too many sections" compilation fails on windows --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fab2fdb60..f71c8c195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,6 +491,9 @@ endif () ## Define harfbuzz library add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers}) target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) +if (MINGW) + target_compile_options(harfbuzz PRIVATE "-Wa,-mbig-obj") +endif() target_include_directories(harfbuzz PUBLIC "$" "$") @@ -534,6 +537,10 @@ if (HB_BUILD_SUBSET) target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) set_target_properties(harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) + if (MINGW) + target_compile_options(harfbuzz-subset PRIVATE "-Wa,-mbig-obj") + endif() + if (BUILD_SHARED_LIBS) if (BUILD_FRAMEWORK) set_target_properties(harfbuzz harfbuzz-subset PROPERTIES From af1b9acc27fe995bf936a4d4e8b59941ff8ea9a9 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 2 Jul 2025 16:55:48 +0300 Subject: [PATCH 09/12] =?UTF-8?q?[glib]=20Drop=20fallback=20code=20for=20v?= =?UTF-8?q?ersions=20we=20don=E2=80=99t=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We require Glib 2.30.0, so drop checks for older versions. --- src/hb-glib.cc | 8 -------- src/hb-gobject-enums.cc.tmpl | 6 ------ src/hb-gobject-structs.cc | 6 ------ test/api/hb-test.h | 9 --------- util/view-cairo.hh | 4 ---- 5 files changed, 33 deletions(-) diff --git a/src/hb-glib.cc b/src/hb-glib.cc index 1da81696e..a85cb365d 100644 --- a/src/hb-glib.cc +++ b/src/hb-glib.cc @@ -127,11 +127,7 @@ hb_glib_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *ab, void *user_data HB_UNUSED) { -#if GLIB_CHECK_VERSION(2,29,12) return g_unichar_compose (a, b, ab); -#else - return false; -#endif } static hb_bool_t @@ -141,11 +137,7 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *b, void *user_data HB_UNUSED) { -#if GLIB_CHECK_VERSION(2,29,12) return g_unichar_decompose (ab, a, b); -#else - return false; -#endif } diff --git a/src/hb-gobject-enums.cc.tmpl b/src/hb-gobject-enums.cc.tmpl index 87a11dd40..cf90ffc32 100644 --- a/src/hb-gobject-enums.cc.tmpl +++ b/src/hb-gobject-enums.cc.tmpl @@ -31,12 +31,6 @@ /* g++ didn't like older gtype.h gcc-only code path. */ #include -#if !GLIB_CHECK_VERSION(2,29,16) -#undef __GNUC__ -#undef __GNUC_MINOR__ -#define __GNUC__ 2 -#define __GNUC_MINOR__ 6 -#endif #include "hb-gobject.h" diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc index d66de0b23..60670b862 100644 --- a/src/hb-gobject-structs.cc +++ b/src/hb-gobject-structs.cc @@ -51,12 +51,6 @@ /* g++ didn't like older gtype.h gcc-only code path. */ #include -#if !GLIB_CHECK_VERSION(2,29,16) -#undef __GNUC__ -#undef __GNUC_MINOR__ -#define __GNUC__ 2 -#define __GNUC_MINOR__ 6 -#endif #include "hb-gobject.h" diff --git a/test/api/hb-test.h b/test/api/hb-test.h index f7ab7b393..2aec8fa23 100644 --- a/test/api/hb-test.h +++ b/test/api/hb-test.h @@ -127,19 +127,10 @@ hb_test_normalize_path (const char *path) } -#if GLIB_CHECK_VERSION(2,25,12) typedef GTestFunc hb_test_func_t; typedef GTestDataFunc hb_test_data_func_t; typedef GTestFixtureFunc hb_test_fixture_func_t; -#else -typedef void (*hb_test_func_t) (void); -typedef void (*hb_test_data_func_t) (gconstpointer user_data); -typedef void (*hb_test_fixture_func_t) (gpointer fixture, gconstpointer user_data); -#endif -#if !GLIB_CHECK_VERSION(2,30,0) -#define g_test_fail() g_error("Test failed") -#endif #ifndef g_assert_true #define g_assert_true g_assert #endif diff --git a/util/view-cairo.hh b/util/view-cairo.hh index 3a486766a..704b49fa8 100644 --- a/util/view-cairo.hh +++ b/util/view-cairo.hh @@ -76,11 +76,7 @@ struct view_cairo_t : view_options_t, output_options_t<> helper_cairo_line_t &line = g_array_index (lines, helper_cairo_line_t, i); line.finish (); } -#if GLIB_CHECK_VERSION (2, 22, 0) g_array_unref (lines); -#else - g_array_free (lines, TRUE); -#endif } protected: From d054ebd5da2efcfaa4a7d96bebf3cae002113a58 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 2 Jul 2025 17:00:12 +0300 Subject: [PATCH 10/12] =?UTF-8?q?[cairo]=20Drop=20fallback=20code=20for=20?= =?UTF-8?q?versions=20we=20don=E2=80=99t=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We require cairo 1.10.0, so drop checks for older versions. --- util/helper-cairo.hh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/helper-cairo.hh b/util/helper-cairo.hh index b6ef80677..59b667775 100644 --- a/util/helper-cairo.hh +++ b/util/helper-cairo.hh @@ -46,8 +46,7 @@ #endif #ifdef CAIRO_HAS_PS_SURFACE # include -# if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0) -# define HAS_EPS 1 +# define HAS_EPS 1 static cairo_surface_t * _cairo_eps_surface_create_for_stream (cairo_write_func_t write_func, @@ -63,9 +62,6 @@ _cairo_eps_surface_create_for_stream (cairo_write_func_t write_func, return surface; } -# else -# undef HAS_EPS -# endif #endif #ifdef CAIRO_HAS_SCRIPT_SURFACE # include From 50debc3720f248e029cef8c2a5b822b4f2407ec0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 13:36:09 +0000 Subject: [PATCH 11/12] Bump github/codeql-action from 3.29.0 to 3.29.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.0 to 3.29.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ce28f5bb42b7a9f2c824e633a3f6ee835bab6858...39edc492dbe16b1465b0cafca41432d857bdb31a) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 22ce68efc..bdfc854d8 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@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 + uses: github/codeql-action/upload-sarif@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1 with: sarif_file: results.sarif From 33a6b8099f4771bf50563cc9abb14ce877cab546 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 13:13:22 +0000 Subject: [PATCH 12/12] Bump github/codeql-action from 3.29.1 to 3.29.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.1 to 3.29.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/39edc492dbe16b1465b0cafca41432d857bdb31a...181d5eefc20863364f96762470ba6f862bdef56b) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index bdfc854d8..66c793f21 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@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1 + uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: sarif_file: results.sarif