From 6d2b8f33e3e189408d35d14888a9c39ae02a5d03 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 19 Mar 2013 14:28:07 +0530 Subject: [PATCH] improve indiancine.ma poster script (light text on dark background seems to compress better) --- scripts/poster.indiancinema.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/poster.indiancinema.py b/scripts/poster.indiancinema.py index 99f278b0..3ac38239 100755 --- a/scripts/poster.indiancinema.py +++ b/scripts/poster.indiancinema.py @@ -31,7 +31,7 @@ def render_poster(title, director, year, frame, timeline, poster): draw = ImageDraw.Draw(poster_image) font_file = os.path.join(static_root, 'SourceSansProSemibold.ttf') font_size = {'cinema': 107, 'director': 32, 'title': 48, 'year': 387} - font_lightness = {'cinema': 0.8 if year else 0.6, 'director': 0.2, 'title': 0.2, 'year': 0.6} + font_lightness = {'cinema': 0.7, 'director': 0.8, 'title': 0.8, 'year': 0.6} poster_lightness = {'image': 0.2, 'text': 0.4} if year: @@ -59,6 +59,16 @@ def render_poster(title, director, year, frame, timeline, poster): ) # cinema + for y in [-1, 1]: + for x in [-1, 1]: + drawText( + poster_image, + (-10 + x, poster_height - timeline_height - font_size['cinema'] + 1 + y), + 'Indiancine.ma', + font_file, + font_size['cinema'], + getRGB((hue, saturation, poster_lightness['text'])) + ) drawText( poster_image, (-10, poster_height - timeline_height - font_size['cinema'] + 1), @@ -112,6 +122,16 @@ def render_poster(title, director, year, frame, timeline, poster): font_size['title'] ) for line in lines: + for y in [-1, 1]: + for x in [-1, 1]: + drawText( + poster_image, + (text_margin + x, offset_top + 4 + y), + line, + font_file, + font_size['title'], + getRGB((hue, saturation, poster_lightness['text'])) + ) drawText( poster_image, (text_margin, offset_top + 4),