diff --git a/dcc/concat.py b/dcc/concat.py index b84db62..6198de3 100644 --- a/dcc/concat.py +++ b/dcc/concat.py @@ -85,12 +85,9 @@ class Concat(dcc.doom_base.Wad): ) mapstring = v.name[-6:-4] text = self._config["map_names"][f"map{mapstring}"] - dcc.text.draw_text( + self.draw_text( img, f"MAP{mapstring}: {text}", - self.thumbnail_font, - self.thumbnail_text_fill, - self.thumbnail_text_stroke, font_size=120 ) img.trim(reset_coords=True) diff --git a/dcc/text.py b/dcc/text.py index 88660c9..3ab654c 100644 --- a/dcc/text.py +++ b/dcc/text.py @@ -1,15 +1,16 @@ +import dcc.config import dcc.doom_base import sys import wand.drawing import wand.image -def draw_text(img, text, font, text_fill, text_stroke, font_size=64): +def draw_text(self, img, text, font_size=64): with wand.drawing.Drawing() as draw: - draw.font = font + draw.font = self.thumbnail_font draw.font_size = font_size - draw.fill_color = wand.color.Color(text_fill) - draw.stroke_color = wand.color.Color(text_stroke) + draw.fill_color = wand.color.Color(self.thumbnail_text_fill) + draw.stroke_color = wand.color.Color(self.thumbnail_text_stroke) draw.stroke_width = font_size * 5 / 32 draw.text_interline_spacing = -font_size / 4 draw.text(5, int(draw.font_size) + 5, text) @@ -19,6 +20,7 @@ def draw_text(img, text, font, text_fill, text_stroke, font_size=64): draw.text(5, int(draw.font_size)+5, text) draw(img) +dcc.config.Base.draw_text = draw_text class Text(dcc.doom_base.WadMap): def get_parser(self, prog_name): @@ -36,11 +38,8 @@ class Text(dcc.doom_base.WadMap): height=self.thumbnail_height, width=self.thumbnail_width ) as img: - draw_text( + self.draw_text( img, text, - self.thumbnail_font, - self.thumbnail_text_fill, - self.thumbnail_text_stroke ) img.trim() img.reset_coords()