From d9d177ecffc48f27e09244367c3794af8122452f Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Wed, 30 Mar 2011 22:08:44 +0800 Subject: [PATCH] osx: Fix font size --- src/spek-platform.c | 8 ++++++++ src/spek-platform.h | 3 +++ src/spek-spectrogram.vala | 7 +------ vapi/spek-platform.vapi | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/spek-platform.c b/src/spek-platform.c index 44159dd..5b2b1fb 100644 --- a/src/spek-platform.c +++ b/src/spek-platform.c @@ -128,3 +128,11 @@ gchar *spek_platform_read_line (const gchar *uri) { return line; #endif } + +gdouble spek_platform_get_font_scale () { +#ifdef G_OS_DARWIN + /* Pango/Quartz fonts are smaller than on X. */ + return 1.4; +#endif + return 1.0; +} diff --git a/src/spek-platform.h b/src/spek-platform.h index 6d87f3b..3662995 100644 --- a/src/spek-platform.h +++ b/src/spek-platform.h @@ -33,4 +33,7 @@ void spek_platform_show_uri (const gchar *uri); /* Read a line from a uri */ gchar *spek_platform_read_line (const gchar *uri); +/* Fonts are smaller on OS X */ +gdouble spek_platform_get_font_scale (); + #endif diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala index c222ade..a84a038 100644 --- a/src/spek-spectrogram.vala +++ b/src/spek-spectrogram.vala @@ -40,14 +40,9 @@ namespace Spek { private const int BPAD = 40; private const int GAP = 10; private const int RULER = 10; - private double FONT_SCALE = 1.0; + private double FONT_SCALE = Platform.get_font_scale (); public Spectrogram () { -#if G_OS_DARWIN - // Pango/Quartz fonts are smaller than on X. - FONT_SCALE = 1.4; -#endif - // Pre-draw the palette. palette = new ImageSurface (Format.RGB24, RULER, BANDS); for (int y = 0; y < BANDS; y++) { diff --git a/vapi/spek-platform.vapi b/vapi/spek-platform.vapi index 849875e..1146051 100644 --- a/vapi/spek-platform.vapi +++ b/vapi/spek-platform.vapi @@ -4,4 +4,5 @@ namespace Spek.Platform { public static void fix_args (string[] args); public static void show_uri (string uri); public static string read_line (string uri); + public static double get_font_scale (); }