From 3ab3e076665d0722d6f12938f3bddf263322539b Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 16 Aug 2022 16:42:39 +0800 Subject: meson.build: Check for GDI and DirectWrite support in HarfBuzz These support are not enabled by default when building HarfBuzz, but if one or both are enabled, we can simplify the codepath to create the needed hb_face_t. This was not added previously as the needed HarfBuzz GDI API was not available at the time the code was written and we are only integrating DirectWrite now. --- meson.build | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meson.build b/meson.build index f233079a..840d37f6 100644 --- a/meson.build +++ b/meson.build @@ -278,6 +278,24 @@ harfbuzz_dep = dependency('harfbuzz', fallback: ['harfbuzz', 'libharfbuzz_dep'], default_options: ['coretext=enabled']) +if host_system == 'windows' + if cpp.has_header_symbol( + 'hb-directwrite.h', + 'hb_directwrite_face_create', + dependencies: harfbuzz_dep, + prefix: '#include ', + ) + pango_conf.set('HAVE_HARFBUZZ_DIRECT_WRITE', 1) + endif + if cc.has_header_symbol( + 'hb-gdi.h', + 'hb_gdi_face_create', + dependencies: harfbuzz_dep, + ) + pango_conf.set('HAVE_HARFBUZZ_GDI', 1) + endif +endif + pango_deps += harfbuzz_dep # If option is 'auto' or 'enabled' it is not required to find fontconfig on the -- cgit v1.2.1