From 457ab827c9b22b813239486ac190468e9adecf65 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Mon, 16 Jun 2025 15:29:08 +0200 Subject: [PATCH] Add definition for IDWriteFactory8 --- meson.build | 8 ++++++++ src/win32/dwrite-extra.hpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/meson.build b/meson.build index eac9e9302..f6431aab6 100644 --- a/meson.build +++ b/meson.build @@ -540,6 +540,14 @@ if host_machine.system() == 'windows' '-DNTDDI_VERSION=0x0A000010', ] + foreach i : range(8, 9) + if cpp_compiler.has_type('IDWriteFactory' + i.to_string(), + prefix: ['#include ', '#include '], + args: sdk_version_args) + conf.set('HAVE_IDWRITEFACTORY' + i.to_string(), 1) + endif + endforeach + if cpp_compiler.has_header('d2d1_2.h') conf.set('HAVE_D2D1_2_H', 1) endif diff --git a/src/win32/dwrite-extra.hpp b/src/win32/dwrite-extra.hpp index 5ad7aea9a..3978badb6 100644 --- a/src/win32/dwrite-extra.hpp +++ b/src/win32/dwrite-extra.hpp @@ -5,6 +5,35 @@ #include +#ifndef HAVE_IDWRITEFACTORY8 + +typedef enum DWRITE_PAINT_FEATURE_LEVEL { + DWRITE_PAINT_FEATURE_LEVEL_NONE = 0, + DWRITE_PAINT_FEATURE_LEVEL_COLR_V0 = 1, + DWRITE_PAINT_FEATURE_LEVEL_COLR_V1 = 2 +} DWRITE_PAINT_FEATURE_LEVEL; + +DEFINE_GUID(IID_IDWriteFactory8, 0xee0a7fb5, 0xdef4, 0x4c23, 0xa4,0x54, 0xc9,0xc7,0xdc,0x87,0x83,0x98); +MIDL_INTERFACE("ee0a7fb5-def4-4c23-a454-c9c7dc878398") +IDWriteFactory8 : public IDWriteFactory7 +{ + virtual HRESULT STDMETHODCALLTYPE TranslateColorGlyphRun( + D2D1_POINT_2F origin, + const DWRITE_GLYPH_RUN *glyph_run, + const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, + DWRITE_GLYPH_IMAGE_FORMATS image_formats, + DWRITE_PAINT_FEATURE_LEVEL feature_level, + DWRITE_MEASURING_MODE measuring_mode, + const DWRITE_MATRIX *world_and_dpi_transform, + UINT32 palette_index, + IDWriteColorGlyphRunEnumerator1 **enumerator) = 0; +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IDWriteFactory8, 0xee0a7fb5, 0xdef4, 0x4c23, 0xa4,0x54, 0xc9,0xc7,0xdc,0x87,0x83,0x98) +#endif + +#endif + #if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 10 // The DWRITE_COLOR_GLYPH_RUN struct isn't valid. //