summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-12 14:24:45 +0000
committerMatthias Clasen <mclasen@redhat.com>2023-05-12 14:24:45 +0000
commitc573c642cae54a57697d72ade3a17259a928fc8f (patch)
tree7700365960363cd409e2b4caf2403851f135755e
parentda18d4197338d349b113330cf6208cc41f8ccf0e (diff)
parenta31602144ff6fc05ff2a26e3c78d618896dc45e5 (diff)
downloadpango-main.tar.gz
Merge branch 'fix-cairo-dwrite' into 'main'HEADmain
pangocairo-win32font.c: Work around Cairo API becoming C++ See merge request GNOME/pango!693
-rw-r--r--pango/pangocairo-win32font.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c
index 9d52dbcf..74dfeab1 100644
--- a/pango/pangocairo-win32font.c
+++ b/pango/pangocairo-win32font.c
@@ -32,6 +32,19 @@
#include <cairo-win32.h>
+#if defined (HAVE_CAIRO_WIN32_DIRECTWRITE) && \
+ ((CAIRO_VERSION_MAJOR > 1) || \
+ (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR > 17) || \
+ (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR == 17 && CAIRO_VERSION_MICRO > 6))
+/*
+ * We are using C here, so use a workaround as cairo-dwrite.h from 1.17.8
+ * can only be used in C++, which replaces the C-friendly version of
+ * cairo_dwrite_font_face_create_for_dwrite_fontface()
+ */
+extern cairo_font_face_t *
+cairo_dwrite_font_face_create_for_dwrite_fontface (void *dwrite_font_face);
+#endif
+
#define PANGO_TYPE_CAIRO_WIN32_FONT (pango_cairo_win32_font_get_type ())
#define PANGO_CAIRO_WIN32_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32Font))
#define PANGO_CAIRO_WIN32_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32FontClass))