From e68e1467a7dcd5f8d7812312c935fd1f0662db6b Mon Sep 17 00:00:00 2001 From: Slipstream Date: Tue, 20 May 2025 21:08:19 -0600 Subject: [PATCH] feat: Increase max font size for captions Increase the maximum font size for captions to 100 and adjust the font size calculation to use 20% of the image height. This allows for larger and more readable text on larger images. --- cogs/caption_cog.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cogs/caption_cog.py b/cogs/caption_cog.py index 9348eff..5b43b63 100644 --- a/cogs/caption_cog.py +++ b/cogs/caption_cog.py @@ -14,7 +14,7 @@ class CaptionCog(commands.Cog, name="Caption"): CAPTION_PADDING = 10 DEFAULT_GIF_DURATION = 100 MIN_FONT_SIZE = 10 - MAX_FONT_SIZE = 50 + MAX_FONT_SIZE = 100 # Increased max font size TEXT_COLOR = (0, 0, 0) # Black text BAR_COLOR = (255, 255, 255) # White bar @@ -36,10 +36,8 @@ class CaptionCog(commands.Cog, name="Caption"): gif = Image.open(io.BytesIO(image_bytes)) frames = [] - # Determine font size (e.g., 10% of image height, capped) - min_font_size = 10 - max_font_size = 50 - font_size = max(min_font_size, min(max_font_size, int(gif.height * 0.1))) + # Determine font size (e.g., 20% of image height, capped) + font_size = max(self.MIN_FONT_SIZE, min(self.MAX_FONT_SIZE, int(gif.height * 0.2))) font = None for font_choice in self.preferred_fonts: