On Tue, Nov 25, 2008 at 2:38 AM, zentara <[EMAIL PROTECTED]> wrote:
>
> --
> I'm not really a human, but I play one on earth.
> http://zentara.net/Remember_How_Lucky_You_Are.html
> _______________________________________________
> Magick-users mailing list
> [email protected]
> http://studio.imagemagick.org/mailman/listinfo/magick-users
Thanks all for your contributions, I got a result finally, here is my script
######################
#!/bin/sh
# Usage: dropshadow.sh text file
# purpose is to create an image file of some text with a drop shadow
# optionally on a transparent back ground
font=Candice.ttf # have hard linked a selection of fonts in my work dir
pointsize=72 # font size in points
offsetx=12
offsety=20 # the distances from the top image to the shadow
blur=0x3 # the parameter to -blur
bgcolor=#ffffffff # if bgcolor=none the shadow is sharp not blurred
fill=white # font fill color
stroke=black # font stroke color
shadowfill=#111 # shadow font fill color
text=$1
opf=$2 #outputfile
# get the size of the text image
convert -background none -fill white -stroke black \
-font $font -pointsize $pointsize label:"$text" \
$opf
# the size I get without using -trim ends up with inaccurate centering
# east-west but it's accurate north-south.
# If I use -trim the north-south centering is so far out
# that the text is clipped at the bottom.
# To use on a solid color needs a fair bit more work to get the east-west
# centering right but I only need a transparent bg at this stage.
textwidth=`identify -format %w $opf`
textheight=`identify -format %h $opf`
imagewidth=`expr $textwidth + $offsetx`
imageheight=`expr $textheight + $offsety`
textx=0
texty=0
shadowx=$offsetx
shadowy=$offsety
convert -size "$imagewidth"x"$imageheight" xc:$bgcolor -gravity NorthWest \
-font $font -pointsize $pointsize \
-fill $shadowfill \
-annotate +$shadowx+$shadowy "$text" -blur $blur \
-fill $fill -stroke $stroke -annotate +$textx+$texty "$text" \
$opf
exit 0
####################
Bob
--
In a world without walls who needs Windows (or Gates)? Try Linux instead!
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users