GNOME Bugzilla – Bug 734038
GTK does not respect system font scaling
Last modified: 2014-07-31 15:21:47 UTC
There's no code for it, so i assume it's not respected.
Created attachment 282136 [details] [review] 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). Also support environment variable GDK_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 user to log off and log on again.
Based on http://blogs.msdn.com/b/oldnewthing/archive/2004/07/14/182971.aspx Interestingly, there are gdk_win32_screen_get_(width|height)_mm functions, which use the same API, but interpret the result differently. I don't see them being used though, so can't make any correlations.
Review of attachment 282136 [details] [review]: Patch makes sense to me.
Review of attachment 282136 [details] [review]: ::: gdk/win32/gdkscreen-win32.c @@ +50,3 @@ + } + + font_resolution = g_getenv ("GDK_FONT_RESOLUTION"); the environment variable should be in a separate commit. also, it would make sense to call it `GDK_WIN32_FONT_RESOLUTION` instead, to ensure that it's clear that it's a win32-only environment variable. unless you would be willing to add support for every backend — in any case, that would need to be a separate commit.
Created attachment 282142 [details] [review] 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). v2: Split into two separate commits
Created attachment 282143 [details] [review] 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.
Review of attachment 282143 [details] [review]: See the nitpick. ::: gdk/win32/gdkscreen-win32.c @@ +40,3 @@ HDC screen_dc; int logpixelsx = -1; + gchar *font_resolution; this should be const gchar *
Created attachment 282146 [details] [review] 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. v2: add const to the envvar pointer
Review of attachment 282142 [details] [review]: looks good.
Review of attachment 282146 [details] [review]: looks reasonable to me.
Attachment 282142 [details] pushed as f38498e - GDK W32: support font scaling Attachment 282146 [details] pushed as a235dd6 - GDK W32: add environment variable to override system font scaling