After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734038 - GTK does not respect system font scaling
GTK does not respect system font scaling
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-07-31 12:49 UTC by LRN
Modified: 2014-07-31 15:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDK W32: support font scaling (1.71 KB, patch)
2014-07-31 12:49 UTC, LRN
reviewed Details | Review
GDK W32: support font scaling (1.23 KB, patch)
2014-07-31 14:05 UTC, LRN
committed Details | Review
GDK W32: add environment variable to override system font scaling (1.48 KB, patch)
2014-07-31 14:05 UTC, LRN
needs-work Details | Review
GDK W32: add environment variable to override system font scaling (1.49 KB, patch)
2014-07-31 14:27 UTC, LRN
committed Details | Review

Description LRN 2014-07-31 12:49:35 UTC
There's no code for it, so i assume it's not respected.
Comment 1 LRN 2014-07-31 12:49:38 UTC
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.
Comment 2 LRN 2014-07-31 12:51:39 UTC
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.
Comment 3 Ignacio Casal Quinteiro (nacho) 2014-07-31 13:29:48 UTC
Review of attachment 282136 [details] [review]:

Patch makes sense to me.
Comment 4 Emmanuele Bassi (:ebassi) 2014-07-31 13:38:04 UTC
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.
Comment 5 LRN 2014-07-31 14:05:22 UTC
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
Comment 6 LRN 2014-07-31 14:05:37 UTC
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.
Comment 7 Ignacio Casal Quinteiro (nacho) 2014-07-31 14:08:13 UTC
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 *
Comment 8 LRN 2014-07-31 14:27:55 UTC
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
Comment 9 Emmanuele Bassi (:ebassi) 2014-07-31 15:10:31 UTC
Review of attachment 282142 [details] [review]:

looks good.
Comment 10 Emmanuele Bassi (:ebassi) 2014-07-31 15:11:15 UTC
Review of attachment 282146 [details] [review]:

looks reasonable to me.
Comment 11 LRN 2014-07-31 15:21:36 UTC
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