Extended startanim.png

This commit is contained in:
2024-11-10 15:37:04 -06:00
parent 5c83fad1f9
commit 06989d61c3
5 changed files with 24 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
pkg/credits/startanim2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -9,6 +9,7 @@
from glob import glob
from os.path import basename, splitext
from subprocess import run
def get_confirmed_names(filename):
with open(filename, 'r') as file:
@@ -81,5 +82,20 @@ def main():
with open('rsrc/dialogs/about-boe.xml', 'w') as output_file:
output_file.write(content)
# Generate startanim.png using ImageMagick
image_lines = ['* OPEN SOURCE CREDITS *', ' ', ' ']
def add_heading(heading):
image_lines.append(f'- {heading.upper()} -')
image_lines.extend(" ")
image_lines.extend(name_dict[heading])
image_lines.extend(" ")
add_heading('Programming')
add_heading('Graphics')
add_heading('Testing')
add_heading('Funding')
run(['pkg/generate-startanim.sh'] + image_lines, input='\n'.join(image_lines), encoding='ascii')
if __name__ == "__main__":
main()

View File

@@ -1,19 +1,19 @@
#!/bin/bash
names=$(grep ^\* DONORS.md)
name_count=$(echo "$names" | wc -l)
text="$(cat)"
line_count=$(echo "$text" | wc -l)
# For clear text, render higher point size at higher density
font_size=8
spacing=0
actual_line_size=$((font_size + spacing + 7))
first_line_offset=$((font_size + 2))
height=$((actual_line_size * name_count))
height=$((actual_line_size * line_count))
# https://www.dafont.com/pix-chicago.font
# TODO calculate line height
magick convert -size 280x$height xc:transparent \
magick -size 280x$height xc:transparent \
-stroke black -pointsize $font_size -interline-spacing $spacing \
-kerning 1 -font pix-Chicago -annotate +0+$first_line_offset "$names" \
startanim2.png
-kerning 1 -font pix-Chicago -annotate +6+$first_line_offset "$text" \
pkg/credits/startanim2.png
magick convert -append pkg/credits/startanim*.png rsrc/graphics/startanim.png