#!/bin/sh # # drft06rr_rectbutton - Make rectangular text web buttons # # Makes a large rectangular button gif given the text and optional color passed # # Paul Wessel, 20-NOV-2001 # if [ $# -eq 0 ];then echo "usage: drft06rr_rectbutton [-f] txt [] [] [D]" >&2 exit fi if [ "$1" = "-f" ]; then force=1 shift else force=0 fi if [ -f $1.gif ] && [ $force -eq 0 ]; then echo "drft06rr_rectbutton: $1.gif already exists, use -f to overwrite it" >&2 exit fi if [ $# -ge 2 ]; then rgb=$2 else rgb=255/0/0 fi if [ $# -eq 3 ]; then pen=$3 else pen=255 fi if [ $# -eq 4 ] && [ $4 = D ]; then # Datable Dredge, choose red rgb=255/0/0 pen=0 elif [ $# -eq 4 ]; then # Other Dredge, choose gold rgb=220/180/0 pen=0 fi gmtset PAPER_MEDIA letter+ txt=`echo $1 | tr '_' ' '` echo "1 0.5 9 0 1 CM $txt" | pstext -R0/2/0/1 -Jx1 -G$pen -W$rgb -P -C0.02/0.02 > t.ps echo "quit" >> t.ps if [ $rgb = "255" ] && [ $pen = "255" ]; then convert -density 15x15 -crop 15x15 t.ps $1.gif else convert -density 100x100 -crop 0x0 t.ps $1.gif fi rm -f t.ps echo "Created image $1.gif"