function shadowText(&$canvas, $o) { $text = defaultText($o); $shadow = $text->clone(); $shadow->blurImage(4, 5, imagick::CHANNEL_ALPHA); $text->colorizeImage($o['color'], 1); $canvas->compositeImage($shadow, imagick::COMPOSITE_OVER, $o['x'] + 5, $o['y'] + 5); $canvas->compositeImage($shadow, imagick::COMPOSITE_OVER, $o['x'], $o['y']); $canvas->compositeImage($text, imagick::COMPOSITE_OVER, $o['x'], $o['y']); }
function shadowedText(&$canvas, $x, $y, $w, $h, $string, $gravity, $font, $color, $wordWrap = false) { $text = defaultText($w, $h, $string, $gravity, $font, $wordWrap); $shadow = $text->clone(); $stroke = $text->clone(); $shadow->blurImage(4, 5, imagick::CHANNEL_ALPHA); $text->colorizeImage($color, 1); $canvas->compositeImage($shadow, imagick::COMPOSITE_OVER, $x + 5, $y + 5); $canvas->compositeImage($shadow, imagick::COMPOSITE_OVER, $x, $y); $canvas->compositeImage($text, imagick::COMPOSITE_OVER, $x, $y); }