[gtk+] GDK W32: support font scaling



commit f38498ed841f6e63b1904e92be48c9f5f429bd31
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Jul 31 14:01:56 2014 +0000

    GDK W32: support font scaling
    
    Respect system font scaling (Control Panel -> Display -> Font Size) and
    convey that information to GDK (which then passes it to Pango).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734038

 gdk/win32/gdkscreen-win32.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index 8cab471..f86d7ce 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -36,6 +36,20 @@ G_DEFINE_TYPE (GdkWin32Screen, gdk_win32_screen, GDK_TYPE_SCREEN)
 static void
 gdk_win32_screen_init (GdkWin32Screen *display)
 {
+  GdkScreen *screen = GDK_SCREEN (display);
+  HDC screen_dc;
+  int logpixelsx = -1;
+
+  screen_dc = GetDC (NULL);
+
+  if (screen_dc)
+    {
+      logpixelsx = GetDeviceCaps(screen_dc, LOGPIXELSX);
+      ReleaseDC (NULL, screen_dc);
+    }
+
+  if (logpixelsx > 0)
+    _gdk_screen_set_resolution (screen, logpixelsx);
 }
 
 static GdkDisplay *


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