osx: Fix font size

This commit is contained in:
Alexander Kojevnikov 2011-03-30 22:08:44 +08:00
parent c7deee63e0
commit d9d177ecff
4 changed files with 13 additions and 6 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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++) {

View File

@ -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 ();
}