Commit a235dd6a authored by LRN's avatar LRN

GDK W32: add environment variable to override system font scaling

Support environment variable GDK_WIN32_FONT_RESOLUTION that can be set to
a desired dpi (72, 96, 130, etc) to override system settings. Useful for
debugging, since changing system font scaling requires the user to log off
and log on again.
parent f38498ed
......@@ -39,6 +39,7 @@ gdk_win32_screen_init (GdkWin32Screen *display)
GdkScreen *screen = GDK_SCREEN (display);
HDC screen_dc;
int logpixelsx = -1;
const gchar *font_resolution;
screen_dc = GetDC (NULL);
......@@ -48,6 +49,14 @@ gdk_win32_screen_init (GdkWin32Screen *display)
ReleaseDC (NULL, screen_dc);
font_resolution = g_getenv ("GDK_WIN32_FONT_RESOLUTION");
if (font_resolution)
int env_logpixelsx = atol (font_resolution);
if (env_logpixelsx > 0)
logpixelsx = env_logpixelsx;
if (logpixelsx > 0)
_gdk_screen_set_resolution (screen, logpixelsx);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment