diff --git a/graphics/titlepic/create_caption b/graphics/titlepic/create_caption index 223d6260..d84da10c 100755 --- a/graphics/titlepic/create_caption +++ b/graphics/titlepic/create_caption @@ -1,11 +1,25 @@ #!/bin/sh +find_font() { + local font fontlist + fontlist=$(convert -list font | awk '$1=="Font:" { print $2 }') + for font in "$@" ; do + if echo $fontlist | grep -q $font ; then + echo $font + return + fi + done +} + +font=$(find_font Helvetica-Bold Liberation-Sans-Bold DejaVu-Sans-Condensed-Bold) +if [ -z "$font" ] ; then echo "Cannot find any fonts" ; exit 1 ; fi + draw_with_footer() { input_file=$1; output_file=$2; shift; shift - convert $input_file -fill white -font Helvetica-Bold \ + convert $input_file -fill white -font "$font" \ -pointsize 11 \ -gravity southwest \ -draw "text 5,5 'https://freedoom.github.io/'" \