[gtk+] quartz: Get default font size from user font



commit b107c9f02cb717ff0714663c8e7ad6703cf09b24
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Aug 24 14:08:57 2014 +0200

    quartz: Get default font size from user font
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735321

 gdk/quartz/gdkevents-quartz.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index d9fa454..2dc6319 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -1638,10 +1638,12 @@ _gdk_quartz_screen_get_setting (GdkScreen   *screen,
     {
       NSString *name;
       char *str;
+      gint size;
 
       GDK_QUARTZ_ALLOC_POOL;
 
       name = [[NSFont systemFontOfSize:0] familyName];
+      size = (gint)[[NSFont userFontOfSize:0] pointSize];
 
       /* Let's try to use the "views" font size (12pt) by default. This is
        * used for lists/text/other "content" which is the largest parts of
@@ -1652,7 +1654,7 @@ _gdk_quartz_screen_get_setting (GdkScreen   *screen,
       /* The size has to be hardcoded as there doesn't seem to be a way to
        * get the views font size programmatically.
        */
-      str = g_strdup_printf ("%s 12", [name UTF8String]);
+      str = g_strdup_printf ("%s %d", [name UTF8String], size);
       g_value_set_string (value, str);
       g_free (str);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]