Adding Drop Shadow to signwriter
behindthepage - September 16, 2006 - 10:30
| Project: | Signwriter |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I used the following code to add a drop shadow to signwriter at
www.helporphansnow.org.au. The shadow is only an approximation
of one done in a graphics program but it does give a bit of depth
to the text. I have posted it here in case someone would like to
play around with it and improve it.
This shadow works well with font size 52.
Insert the following code at line 601 before imagettftext
$xoffset = 0;
$yoffset = 0;
$drop[] = '';
$drop[] = imagecolorallocate($im, 208, 208, 208);
$drop[] = imagecolorallocate($im, 208, 208, 208);
$drop[] = imagecolorallocate($im, 226, 226, 226);
$drop[] = imagecolorallocate($im, 240, 240, 240);
$drop[] = imagecolorallocate($im, 250, 250, 250);
$num = count($drop);
//write drop shadow
for ($i = $num; $i > 0; $i--){
imagettftext($im, $size, $angle, $x + $xoffset + $i, $y + abs($box[5]) + $yoffset + $i, $drop[$i], $fontfile, $text);
}Regards
gpdinoz

#1
Thanks for the code gpdinoz.
Drop shadow functionality has been added to 5.x-1.2.
A new fieldset has been added to the profile settings page that allows you to turn drop shadow on and off as well as select the drop shadow's colour and set it's X and Y offsets from the original text.
#2
#3
Cool. I may have another addition soon. I have modified your module to write vertically and used it to write the headers in a views table so I could fit 46 column wide tables on a page. http://www.col.net.au/contractors
Another place I have used it lately is to provide title images to a flash front end sending the image url via AMFPHP service. It is a very useful module.
Regards
Geoff
#4
Automatically closed -- issue fixed for two weeks with no activity.