diff options
Diffstat (limited to 'hacks/filmleader.c')
-rw-r--r-- | hacks/filmleader.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/hacks/filmleader.c b/hacks/filmleader.c index c242083..454b91d 100644 --- a/hacks/filmleader.c +++ b/hacks/filmleader.c @@ -11,20 +11,11 @@ * Simulate an SMPTE Universal Film Leader playing on an analog television. */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include "xft.h" /* before screenhack.h */ - #include "screenhack.h" #include "analogtv.h" #include <time.h> -#undef countof -#define countof(x) (sizeof((x))/sizeof((*x))) - struct state { Display *dpy; Window window; @@ -126,11 +117,13 @@ filmleader_init (Display *dpy, Window window) "traceColor", "Foreground"); s = get_string_resource (dpy, "textColor", "Foreground"); + if (!s) s = strdup ("white"); XftColorAllocName (dpy, st->xgwa.visual, st->xgwa.colormap, s, &st->xft_text_color_1); - if (s) free (s); + free (s); s = get_string_resource (dpy, "textBackground", "Background"); + if (!s) s = strdup ("black"); XftColorAllocName (dpy, st->xgwa.visual, st->xgwa.colormap, s, &st->xft_text_color_2); if (s) free (s); @@ -170,14 +163,6 @@ filmleader_draw (Display *dpy, Window window, void *closure) XftFont *xftfont; XftColor *xftcolor; - /* You may ask, why use Xft for this instead of the much simpler XDrawString? - Well, for some reason, XLoadQueryFont is giving me horribly-scaled bitmap - fonts, but Xft works properly. So perhaps in This Modern World, if one - expects large fonts to work, one must use Xft instead of Xlib? - - Everything is terrible. - */ - const struct { double t; int k, f; const char * const s[4]; } blurbs[] = { { 9.1, 3, 1, { "PICTURE", " START", 0, 0 }}, { 10.0, 2, 1, { " 16", "SOUND", "START", 0 }}, @@ -550,28 +535,19 @@ static const char *filmleader_defaults [] = { 712 x Y or X x 712 canvas that we draw in, which is then scaled to the size of the screen by analogtv. */ -# ifdef USE_IPHONE +# if defined(HAVE_IPHONE) || defined(HAVE_COCOA) "*numberFont: Helvetica Bold 120", "*numberFont2: Helvetica 36", "*numberFont3: Helvetica 28", - -# elif defined(HAVE_COCOA) - /* Need to double these because ANALOGTV_DEFAULTS sets lowrez: true */ - "*numberFont: Helvetica Bold 240", - "*numberFont2: Helvetica 72", - "*numberFont3: Helvetica 56", - # else /* X11 or Android */ - - "*numberFont: -*-helvetica-bold-r-*-*-*-1700-*-*-*-*-*-*", - "*numberFont2: -*-helvetica-medium-r-*-*-*-500-*-*-*-*-*-*", - "*numberFont3: -*-helvetica-medium-r-*-*-*-360-*-*-*-*-*-*", - + "*numberFont: Helvetica Bold 170", + "*numberFont2: Helvetica 50", + "*numberFont3: Helvetica 36", # endif - "*noise: 0.04", ANALOGTV_DEFAULTS + ".lowrez: false", /* Required on macOS, or font size fucks up */ "*geometry: 1280x720", 0 }; |