From f993c1f22cd8f5176ba2c1277ca3f3851ae3bdd0 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 26 Mar 2025 06:51:36 -1000 Subject: [PATCH] feat: Improve celebration image with glow effect and tighter spacing --- generate_celebration_image.py | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/generate_celebration_image.py b/generate_celebration_image.py index c9eaa40ae..db5b509d1 100644 --- a/generate_celebration_image.py +++ b/generate_celebration_image.py @@ -12,10 +12,10 @@ FONT_SIZE_MEDIUM = 55 FONT_SIZE_SMALL = 30 OUTPUT_FILENAME = "aider_30k_stars_celebration.svg" -# Font families - SVG will try these in order. Ensure viewers have suitable fonts. -FONT_FAMILY_BOLD = "'DejaVu Sans Bold', 'Arial Bold', 'Helvetica Bold', sans-serif-bold, sans-serif" -FONT_FAMILY_REGULAR = "'DejaVu Sans', 'Arial', 'Helvetica', sans-serif" -# Use Bold for Medium as per original Pillow logic attempt +# Font families - SVG will try these in order. Prioritize Inter, then fall back. +FONT_FAMILY_BOLD = "'Inter Bold', 'DejaVu Sans Bold', 'Arial Bold', 'Helvetica Bold', sans-serif-bold, sans-serif" +FONT_FAMILY_REGULAR = "'Inter', 'DejaVu Sans', 'Arial', 'Helvetica', sans-serif" +# Use Bold for Medium for consistency and visual weight FONT_FAMILY_MEDIUM = FONT_FAMILY_BOLD # --- Paths (Adjust if needed) --- @@ -51,18 +51,20 @@ logo_y_pos = HEIGHT * 0.15 logo_x_pos = center_x - (logo_width / 2) # Adjust text start based on whether logo is present -text_start_y = logo_y_pos + logo_height + 40 if logo_data_uri else HEIGHT * 0.2 +text_start_y = logo_y_pos + logo_height + 30 if logo_data_uri else HEIGHT * 0.2 # Slightly reduced gap current_y = text_start_y # Calculate Y positions for each line (using dominant-baseline="middle" for vertical centering) line1_y = current_y + FONT_SIZE_MEDIUM / 2 -current_y += FONT_SIZE_MEDIUM + 30 +current_y += FONT_SIZE_MEDIUM + 25 # Reduced gap line2_y = current_y + FONT_SIZE_LARGE / 2 -current_y += FONT_SIZE_LARGE + 15 +current_y += FONT_SIZE_LARGE + 10 # Reduced gap line3_y = current_y + FONT_SIZE_MEDIUM / 2 -current_y += FONT_SIZE_MEDIUM + 60 -line4_y = HEIGHT - FONT_SIZE_SMALL - 30 + FONT_SIZE_SMALL / 2 # Position near bottom +# Removed large gap calculation here, line4_y is positioned from bottom + +# Position line 4 relative to the bottom edge +line4_y = HEIGHT - FONT_SIZE_SMALL - 25 + FONT_SIZE_SMALL / 2 # Position near bottom, slightly higher # --- Generate SVG Content --- svg_elements = [] @@ -86,7 +88,7 @@ svg_elements.append( svg_elements.append( f'{line2}' + f' dominant-baseline="middle" filter="url(#text-glow)">{line2}' # Added glow filter ) svg_elements.append( f' + + + + + + +