From 4da15dadff3851beab778c092cac247096fbaca0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 12 Mar 2026 02:53:11 -0300 Subject: [PATCH] [meson] Add raster/vector feature macros Raster and vector libraries were configurable, but hb-features.h.in did not expose matching HB_HAS_* macros. Set HAVE_RASTER and HAVE_VECTOR during configuration, include both features in the generated hb-features.h list, and add them to the gtk-doc section index. Testing: meson test -C build Assisted-by: OpenAI Codex --- docs/harfbuzz-sections.txt | 2 ++ meson.build | 8 ++++++++ src/hb-features.h.in | 14 ++++++++++++++ src/meson.build | 2 ++ 4 files changed, 26 insertions(+) diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 293fabdcc..bee7ef095 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -206,7 +206,9 @@ HB_HAS_GLIB HB_HAS_GOBJECT HB_HAS_GRAPHITE HB_HAS_ICU +HB_HAS_RASTER HB_HAS_UNISCRIBE +HB_HAS_VECTOR HB_HAS_WASM diff --git a/meson.build b/meson.build index cce0ef760..bb6d45c4c 100644 --- a/meson.build +++ b/meson.build @@ -256,6 +256,14 @@ if get_option('experimental_api') conf.set('HB_EXPERIMENTAL_API', 1) endif +if not get_option('raster').disabled() + conf.set('HAVE_RASTER', 1) +endif + +if not get_option('vector').disabled() + conf.set('HAVE_VECTOR', 1) +endif + if freetype_dep.found() conf.set('HAVE_FREETYPE', 1) check_freetype_funcs = [ diff --git a/src/hb-features.h.in b/src/hb-features.h.in index 4b27bd5e7..9726140b6 100644 --- a/src/hb-features.h.in +++ b/src/hb-features.h.in @@ -99,6 +99,13 @@ HB_BEGIN_DECLS */ #mesondefine HB_HAS_ICU +/** + * HB_HAS_RASTER: + * + * Defined if Harfbuzz has been built with the raster library. + */ +#mesondefine HB_HAS_RASTER + /** * HB_HAS_UNISCRIBE: * @@ -106,6 +113,13 @@ HB_BEGIN_DECLS */ #mesondefine HB_HAS_UNISCRIBE +/** + * HB_HAS_VECTOR: + * + * Defined if Harfbuzz has been built with the vector library. + */ +#mesondefine HB_HAS_VECTOR + /** * HB_HAS_WASM: * diff --git a/src/meson.build b/src/meson.build index 67e00c06c..c95e9f16d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -586,7 +586,9 @@ features = [ 'GOBJECT', 'GRAPHITE', 'ICU', + 'RASTER', 'UNISCRIBE', + 'VECTOR', 'WASM', ]