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 735321 - Get the default gkt-font-name font size from user font
Get the default gkt-font-name font size from user font
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
3.13.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-08-24 12:06 UTC by jessevdk@gmail.com
Modified: 2014-08-28 18:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quartz: Get default font size from user font (1.37 KB, patch)
2014-08-27 18:49 UTC, jessevdk@gmail.com
committed Details | Review

Description jessevdk@gmail.com 2014-08-24 12:06:16 UTC
The current font size for the quartz backend is set to 12pt, with a comment that this size cannot be obtained from the system. It's possible to obtain the size of the default user font though (the font used normally for user input widgets, e.g. text entry). The size of that font can be easily obtained by: (gint)[[NSFont userFontOfSize:0] pointSize];
Comment 1 Matthias Clasen 2014-08-27 18:41:20 UTC
could you provide a (tested) patch ?
Comment 2 jessevdk@gmail.com 2014-08-27 18:49:57 UTC
Created attachment 284627 [details] [review]
quartz: Get default font size from user font
Comment 3 Matthias Clasen 2014-08-28 17:24:33 UTC
Review of attachment 284627 [details] [review]:

::: gdk/quartz/gdkevents-quartz.c
@@ +1645,2 @@
       name = [[NSFont systemFontOfSize:0] familyName];
+      size = (gint)[[NSFont userFontOfSize:0] pointSize];

Is it concerning that we are combining fragments of the 'system font' and the 'user font' here ? or am I misinterpreting these names ?
Comment 4 jessevdk@gmail.com 2014-08-28 17:28:51 UTC
No, you are right. The problem is that the comment just above mentions that the "views" font size looks "good", but cannot be programmatically obtained. Getting the size from the userFont, even though it's not the same font as the system font, is the closest I could find from getting away from the hardcoded font size. I think it's still better than hardcoding it at 12.
Comment 5 Matthias Clasen 2014-08-28 18:01:05 UTC
Review of attachment 284627 [details] [review]:

I see. ok then, lets go with this. if it turns out to be a bad idea, we can always go back to hardcoding
Comment 6 jessevdk@gmail.com 2014-08-28 18:03:07 UTC
Thanks!