[gtk/fix-4565: 2/2] demos/gtk-demo/font_features.c: Fix build on Pango < 1.44.x




commit bec88ded5f262321fb46eb86abe8dc4955a89668
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Dec 30 15:33:14 2021 +0800

    demos/gtk-demo/font_features.c: Fix build on Pango < 1.44.x
    
    The Pango headers prior to 1.44.0 do not include the HarfBuzz headers, so we
    need to re-structure how we check for HarfBuzz 2.2.0 or later if we have Pango
    1.44.x or later.
    
    Fixes issue #4565.

 demos/gtk-demo/font_features.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index ab9ae0d66c..19fa674b5b 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -10,8 +10,12 @@
 
 #include <gtk/gtk.h>
 
-#if !(PANGO_VERSION_CHECK(1,44,0) && HB_VERSION_ATLEAST(2,2,0))
-#define FONT_FEATURES_USE_PANGOFT2 1
+#if PANGO_VERSION_CHECK(1,44,0)
+# if !HB_VERSION_ATLEAST(2,2,0)
+#  define FONT_FEATURES_USE_PANGOFT2 1
+# endif
+#else
+# define FONT_FEATURES_USE_PANGOFT2 1
 #endif
 
 #ifdef FONT_FEATURES_USE_PANGOFT2
@@ -231,7 +235,7 @@ update_script_combo (void)
   pango_font = get_pango_font ();
 
 #ifdef FONT_FEATURES_USE_PANGOFT2
-  if (PANGO_IS_FC_FONT (pango_font)
+  if (PANGO_IS_FC_FONT (pango_font))
     {
       ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
       hb_font = hb_ft_font_create (ft_face, NULL);
@@ -291,7 +295,7 @@ update_script_combo (void)
     }
 
 #ifdef FONT_FEATURES_USE_PANGOFT2
-  if (PANGO_IS_FC_FONT (pango_font)
+  if (PANGO_IS_FC_FONT (pango_font))
     pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
 #endif
 
@@ -397,7 +401,7 @@ update_features (void)
   pango_font = get_pango_font ();
 
 #ifdef FONT_FEATURES_USE_PANGOFT2
-  if (PANGO_IS_FC_FONT (pango_font)
+  if (PANGO_IS_FC_FONT (pango_font))
     {
       ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
       hb_font = hb_ft_font_create (ft_face, NULL);
@@ -442,7 +446,7 @@ update_features (void)
     }
 
 #ifdef FONT_FEATURES_USE_PANGOFT2
-  if (PANGO_IS_FC_FONT (pango_font)
+  if (PANGO_IS_FC_FONT (pango_font))
     pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
 #endif
 


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