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): ...@@ -192,8 +192,7 @@ class Widget(object):
outline=COLOR_DATA[self.color]['border'] outline=COLOR_DATA[self.color]['border']
) )
def render_text(self, text, lang_text, base_font_size, bold_font, def get_text(self, text, lang_text):
pos_x, pos_y):
# Use language variant if desired # Use language variant if desired
if self.lang is not None and lang_text is not None: if self.lang is not None and lang_text is not None:
text = lang_text text = lang_text
...@@ -201,7 +200,11 @@ class Widget(object): ...@@ -201,7 +200,11 @@ class Widget(object):
text = text.replace('English', self.lang.name) text = text.replace('English', self.lang.name)
# Format text # 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) base_font = is_base(text)
offset = 0 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