GNOME Bugzilla – Bug 735321
Get the default gkt-font-name font size from user font
Last modified: 2014-08-28 18:03:07 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];
could you provide a (tested) patch ?
Created attachment 284627 [details] [review] quartz: Get default font size from user font
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 ?
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.
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
Thanks!