[gtk] GDK W32: set default settings for fontconfig.



commit 67fdfca3ba28d82a7cfe02d4d5fe34c910e6c959
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat Dec 1 10:38:10 2018 +0100

    GDK W32: set default settings for fontconfig.
    
    Enables hinting, antialiasing and set the subpixel orientation according to the
    active clear type setting. This ensures that font rendering with the fontconfig backend
    looks similar to the win32 backend, at least with the default system font.
    
    See !437

 gdk/win32/gdkproperty-win32.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
---
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index be37ef7d0c..536cb5a10b 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -124,6 +124,42 @@ _gdk_win32_get_setting (const gchar *name,
       g_value_set_boolean (value, TRUE);
       return TRUE;
     }
+  else if (strcmp ("gtk-xft-hinting", name) == 0)
+    {
+      GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : 1\n", name));
+      g_value_set_int (value, 1);
+      return TRUE;
+    }
+  else if (strcmp ("gtk-xft-antialias", name) == 0)
+    {
+      GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : 1\n", name));
+      g_value_set_int (value, 1);
+      return TRUE;
+    }
+  else if (strcmp ("gtk-xft-hintstyle", name) == 0)
+    {
+      g_value_set_static_string (value, "hintfull");
+      GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %s\n", name, g_value_get_string (value)));
+      return TRUE;
+    }
+  else if (strcmp ("gtk-xft-rgba", name) == 0)
+    {
+      unsigned int orientation = 0;
+      if (SystemParametersInfoW (SPI_GETFONTSMOOTHINGORIENTATION, 0, &orientation, 0))
+        {
+          if (orientation == FE_FONTSMOOTHINGORIENTATIONRGB)
+            g_value_set_static_string (value, "rgb");
+          else if (orientation == FE_FONTSMOOTHINGORIENTATIONBGR)
+            g_value_set_static_string (value, "bgr");
+          else
+            g_value_set_static_string (value, "none");
+        }
+      else
+        g_value_set_static_string (value, "none");
+
+      GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %s\n", name, g_value_get_string (value)));
+      return TRUE;
+    }
   else if (strcmp ("gtk-font-name", name) == 0)
     {
       NONCLIENTMETRICS ncm;


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