[xwax-devel] [PATCH 1/2] Initial zoom test
Brought to you by:
hills
From: Mark H. <ma...@xw...> - 2013-02-21 20:54:56
|
Just an initial patch whic uses a fixed zoom level which is defined in the code. Makes xwax usable on high resolution (even Retina) displays. --- interface.c | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/interface.c b/interface.c index d0253db..18d1c94 100644 --- a/interface.c +++ b/interface.c @@ -40,6 +40,8 @@ #include "timecoder.h" #include "xwax.h" +#define zoom(x) (int)((x) * 1.5) + /* Screen refresh time in milliseconds */ #define REFRESH 10 @@ -47,24 +49,24 @@ /* Font definitions */ #define FONT "DejaVuSans.ttf" -#define FONT_SIZE 10 -#define FONT_SPACE 15 +#define FONT_SIZE zoom(10) +#define FONT_SPACE zoom(15) #define EM_FONT "DejaVuSans-Oblique.ttf" #define BIG_FONT "DejaVuSans-Bold.ttf" -#define BIG_FONT_SIZE 14 -#define BIG_FONT_SPACE 19 +#define BIG_FONT_SIZE zoom(14) +#define BIG_FONT_SPACE zoom(19) #define CLOCK_FONT FONT -#define CLOCK_FONT_SIZE 32 +#define CLOCK_FONT_SIZE zoom(32) #define DECI_FONT FONT -#define DECI_FONT_SIZE 20 +#define DECI_FONT_SIZE zoom(20) #define DETAIL_FONT "DejaVuSansMono.ttf" -#define DETAIL_FONT_SIZE 9 -#define DETAIL_FONT_SPACE 12 +#define DETAIL_FONT_SIZE zoom(9) +#define DETAIL_FONT_SPACE zoom(12) /* Screen dimensions */ @@ -72,36 +74,37 @@ #define DEFAULT_HEIGHT 720 #define BORDER 12 -#define SPACER 8 -#define HALF_SPACER 4 +#define SPACER zoom(8) +#define HALF_SPACER zoom(4) -#define CURSOR_WIDTH 4 +#define CURSOR_WIDTH zoom(4) -#define PLAYER_HEIGHT 213 -#define OVERVIEW_HEIGHT 16 +#define PLAYER_HEIGHT zoom(213) +#define OVERVIEW_HEIGHT zoom(16) -#define LIBRARY_MIN_WIDTH 64 -#define LIBRARY_MIN_HEIGHT 64 +#define LIBRARY_MIN_WIDTH zoom(64) +#define LIBRARY_MIN_HEIGHT zoom(64) #define DEFAULT_METER_SCALE 8 +#define DEFAULT_UI_SCALE 4 #define MAX_METER_SCALE 11 #define SEARCH_HEIGHT (FONT_SPACE) #define STATUS_HEIGHT (DETAIL_FONT_SPACE) -#define BPM_WIDTH 32 -#define SORT_WIDTH 22 -#define RESULTS_ARTIST_WIDTH 200 +#define BPM_WIDTH zoom(32) +#define SORT_WIDTH zoom(22) +#define RESULTS_ARTIST_WIDTH zoom(200) -#define TOKEN_SPACE 2 +#define TOKEN_SPACE zoom(2) -#define CLOCKS_WIDTH 160 +#define CLOCKS_WIDTH zoom(160) -#define SPINNER_SIZE (CLOCK_FONT_SIZE * 2 - 6) -#define SCOPE_SIZE (CLOCK_FONT_SIZE * 2 - 6) +#define SPINNER_SIZE (CLOCK_FONT_SIZE * 2 - zoom(6)) +#define SCOPE_SIZE (CLOCK_FONT_SIZE * 2 - zoom(6)) -#define SCROLLBAR_SIZE 10 +#define SCROLLBAR_SIZE zoom(10) #define METER_WARNING_TIME 20 /* time in seconds for "red waveform" warning */ @@ -156,7 +159,7 @@ static SDL_Color background_col = {0, 0, 0, 255}, static int spinner_angle[SPINNER_SIZE * SPINNER_SIZE]; static int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT, - meter_scale = DEFAULT_METER_SCALE; + meter_scale = DEFAULT_METER_SCALE, ui_scale = DEFAULT_UI_SCALE; static pthread_t ph; static struct selector selector; @@ -370,6 +373,9 @@ static TTF_Font* open_font(const char *name, int size) { fputs(TTF_GetError(), stderr); fputc('\n', stderr); } + + TTF_SetFontHinting(font, TTF_HINTING_NONE); + return font; /* or NULL */ } -- 1.7.12.1 |