#!/bin/sh TEXT1="テキスト1" TEXT2="テキスト2" TEXT3="テキスト3" TEXT4="テキスト4" # Font Filename or Font name. see also "convert -list font". FONT="/usr/pkg/lib/X11/fonts/TTF/VL-Gothic-Regular.ttf" # point size for drawing text POINT_SIZE=96 # output image size OUTPUT_SIZE="1280x1024" BORDER_WIDTH=128 # drawing image size -- maybe this calculate from output/border size or from input file IMG_WIDTH=1024 IMG_HEIGHT=768 IMG_SIZE="${IMG_WIDTH}x${IMG_HEIGHT}" # text box size TEXTH_WIDTH=`expr $BORDER_WIDTH + $IMG_WIDTH` TEXTV_WIDTH=`expr $BORDER_WIDTH + $IMG_HEIGHT` TEXTH_SIZE="${TEXTH_WIDTH}x${BORDER_WIDTH}" TEXTV_SIZE="${TEXTV_WIDTH}x${BORDER_WIDTH}" if [ $# -ge 2 ]; then INPUT_FILE=$1 OUTPUT_FILE=$2 convert -size ${OUTPUT_SIZE} xc:white \ -fill black -background white -font $FONT -pointsize ${POINT_SIZE} \ -size ${TEXTH_SIZE} label:${TEXT1} -composite \ \( -size ${TEXTV_SIZE} label:${TEXT2} -rotate 90 \) \ -gravity northwest -geometry +${TEXTH_WIDTH}+0 -composite \ \( -size ${TEXTH_SIZE} label:${TEXT3} -rotate 180 \) \ -gravity northwest -geometry +${BORDER_WIDTH}+${TEXTV_WIDTH} -composite \ \( -size ${TEXTV_SIZE} label:${TEXT4} -rotate 270 \) \ -gravity northwest -geometry +0+${BORDER_WIDTH} -composite \ \( ${INPUT_FILE} -gravity northwest -geometry +${BORDER_WIDTH}+${BORDER_WIDTH} \ -resize ${IMG_WIDTH}x${IMG_HEIGHT} \) -composite \ ${OUTPUT_FILE} fi