[pango/pango2-windows: 217/222] pangocairo-fontmap.c: Fix build on Windows




commit b862eb4464e2ed5c7509e62c80d06f73356f0472
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jun 9 10:40:09 2022 +0800

    pangocairo-fontmap.c: Fix build on Windows
    
    Drop any non-HB Windows-specific items from this file, and include the
    DirectWrite support we recently added to get our PangoFontMap.  Note that Cairo
    recently added DirectWrite support, so this may very well require a bleeding-
    edge Cairo build in order to work properly, but at least this fixes the build
    on Windows (I will look into Uniscribe/GDI support, in another MR).
    
    Also include stdlib.h, since we need it for getenv().

 pango/pangocairo-fontmap.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c
index 01dd5218..9df2ee38 100644
--- a/pango/pangocairo-fontmap.c
+++ b/pango/pangocairo-fontmap.c
@@ -20,6 +20,7 @@
  */
 
 #include "config.h"
+#include <stdlib.h>
 
 #include "pangocairo.h"
 #include "pangocairo-private.h"
@@ -29,7 +30,7 @@
 #  include "pangocoretext-hbfontmap.h"
 #endif
 #if defined (HAVE_CAIRO_WIN32)
-#  include "pangocairo-win32.h"
+#  include "pangodwrite-hbfontmap.h"
 #endif
 #if defined (HAVE_CAIRO_FREETYPE)
 #  include "pangofc-hbfontmap.h"
@@ -81,7 +82,7 @@ pango_cairo_font_map_new (void)
 #endif
 #if defined(HAVE_CAIRO_WIN32)
   if (!backend || 0 == strcmp (backend, "win32"))
-    return g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT_MAP, NULL);
+    return (PangoFontMap *) pango_direct_write_hb_font_map_new ();
 #endif
 #if defined(HAVE_CAIRO_FREETYPE)
   if (!backend || 0 == strcmp (backend, "fc")
@@ -128,10 +129,6 @@ pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype)
 #if defined(HAVE_CORE_TEXT) && defined (HAVE_CAIRO_QUARTZ)
     case CAIRO_FONT_TYPE_QUARTZ:
       return g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT_MAP, NULL);
-#endif
-#if defined(HAVE_CAIRO_WIN32)
-    case CAIRO_FONT_TYPE_WIN32:
-      return g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT_MAP, NULL);
 #endif
     default:
       return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]