commit d9d177ecffc48f27e09244367c3794af8122452f
parent c7deee63e0c24ef8ac113315f75f61d9852abc25
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Wed, 30 Mar 2011 22:08:44 +0800
osx: Fix font size
Diffstat:
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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 ();
}