From: Radek Czajka Date: Tue, 3 Apr 2012 08:26:01 +0000 (+0200) Subject: #2044: handle weird whitespace for covers X-Git-Tag: 1.7~162 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/a07a4a9202091de4902baa709e7ec83c837eb4b5?ds=sidebyside;hp=--cc #2044: handle weird whitespace for covers --- a07a4a9202091de4902baa709e7ec83c837eb4b5 diff --git a/librarian/cover.py b/librarian/cover.py index 23603d6..925449e 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -3,6 +3,7 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +import re import Image, ImageFont, ImageDraw, ImageFilter from librarian import get_resource @@ -36,6 +37,7 @@ class TextBox(object): def text(self, text, color='#000', font=None, line_height=20, shadow_color=None): """Writes some centered text.""" + text = re.sub(r'\s+', ' ', text) if shadow_color: if not self.shadow_img: self.shadow_img = Image.new('RGBA', self.img.size) diff --git a/setup.py b/setup.py index b1ea926..7ea9ed0 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def whole_tree(prefix, path): setup( name='librarian', - version='1.4.1', + version='1.4.2a', description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats', author="Marek Stępniowski", author_email='marek@stepniowski.com',