PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Images » Image_Text » Bug #2450

Drop Shadows

Details

Request #2450Drop Shadows
Submitted2004-10-04 20:54 UTC
Fromse at hexatex dot de
Assignedbigmichi1
StatusClosed
PackageImage_Text
PHP Version4.3.8
Roadmaps0.8.0

Comments

[2004-10-04 20:54 UTC] se at hexatex dot de

Description:
------------
It would be nice to have an easy way to have drop shadows.

Reproduce code:
---------------
# this is what I did to emulate drop shadows, it is probably not ideal
$c = 'A Headline!';
$w = 510;
$h = 80;

$options1 = array(
'canvas' => array('width'=> $w,'height'=> $h + 1),
'width' => $w,
'height' => $h - 10,
'line_spacing' => .4,
'color' => '#333333',
'max_lines' => 3,
'min_font_size' => 2,
'max_font_size' => 50,
'font_size' => 36,
'font_path' => LIBDIR . '/fonts/',
'font_file' => 'trebuc.ttf',
'valign' => IMAGE_TEXT_ALIGN_BOTTOM
);
$options2 = $options1;
$options2['color'] ='#000000';

$text1 = new Image_Text($c, $options1);
$text2 = new Image_Text($c, $options2);

$text1->init();
$text2->init();

$img1 =& $text1->getImg();
$img2 =& $text2->getImg();

$white = imagecolorallocate($img1, 255, 255, 255);

imagefilledrectangle($img1, 0, 0, $w, $h, $white);
imagefilledrectangle($img2, 0, 0, $w, $h, $white);

$text1->autoMeasurize(14, 26);
$text2->autoMeasurize(14, 26);

$text2->render();
imagecopymerge($img1, $img2, 1, 1, 0, 0, $w, $h, 30);
$text1->render();
$text1->display();