Commit a74314d3 authored by Michal Čihař's avatar Michal Čihař

Split text generating from rendering

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 2fee3539
......@@ -192,8 +192,7 @@ class Widget(object):
outline=COLOR_DATA[self.color]['border']
)
def render_text(self, text, lang_text, base_font_size, bold_font,
pos_x, pos_y):
def get_text(self, text, lang_text):
# Use language variant if desired
if self.lang is not None and lang_text is not None:
text = lang_text
......@@ -201,7 +200,11 @@ class Widget(object):
text = text.replace('English', self.lang.name)
# Format text
text = text % self.params
return text % self.params
def render_text(self, text, lang_text, base_font_size, bold_font,
pos_x, pos_y):
text = self.get_text(text, lang_text)
base_font = is_base(text)
offset = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment