diff --git a/stockTicker.py b/stockTicker.py index c1dd649..b9deeb0 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -705,15 +705,10 @@ class StockTicker(): #displays the text entered in the webpage by the user. - - - f = open('csv/message_settings.json', 'r') all_settings = json.load(f) f.close() - - - + colours = {'Black':(0,0,0), 'White':(255,255,255), 'Red':(255,0,0), @@ -738,14 +733,14 @@ class StockTicker(): elif message["size"] == 'Small': font = ImageFont.load("./fonts/6x13.pil") location = (0, 7) - - + r,g,b = colours[message['text_colour']] background = colours[message['background_colour']] + decoded = message['text'].encode("ascii","ignore") + message['text'] = decoded.decode() img = self.textImage(message['text'], font, int(r), int(g), int(b), True, w_buff = 5, background = background, location = location) - - + if all_settings['title'] and ind == 0: title_img = self.openImage('feature_titles/message.png') imgs.append(self.stitchImage([title_img, img]))