Move the remaining hardcoded constants into the configuration file.

This commit is contained in:
yrriban 2025-07-03 18:04:19 -04:00
parent 4bbf57036d
commit d778e281ba
4 changed files with 25 additions and 30 deletions

View file

@ -6,10 +6,10 @@ import wand.image
def draw_text(img, text, font_size=64):
with wand.drawing.Drawing() as draw:
draw.font = dcc.config.FONT
draw.font = self.thumbnail_font
draw.font_size = font_size
draw.fill_color = wand.color.Color(dcc.config.TEXT_FILL_COLOR)
draw.stroke_color = wand.color.Color(dcc.config.TEXT_STROKE_COLOR)
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)
@ -33,8 +33,8 @@ class Text(dcc.doom_base.WadMap):
text = "MAP{}: {}".format(parsed_args.map, text)
text = "{}\n{}".format(text, parsed_args.demotype)
with wand.image.Image(
height=dcc.config.THUMB_HEIGHT,
width=dcc.config.THUMB_WIDTH
height=self.thumbnail_height,
width=self.thumbnail_height
) as img:
draw_text(img, text)
img.trim()