php gd - How to add text shadow to overlay text using PHP -
i want add overlay text text shadow image. far have been able achieve this
// top text imagettftext($im, $font_size+2, 0, $text1_params['centered_start'], $font_size+$margin, $black, $font, $text1_params['text'] ); imagettftext($im, $font_size, 0, $text1_params['centered_start'], $font_size+$margin, $white, $font, $text1_params['text'] ); // bottom text imagettftext($im, $font_size, 0, $text2_params['centered_start'] , $image_height-$text2_params['height']+$font_size+$margin, $black, $font, $text2_params['text'] ); imagettftext($im, $font_size, 0, $text2_params['centered_start']-2, $image_height-$text2_params['height']+$font_size+$margin-2, $white, $font, $text2_params['text'] );
this result looks like-
want this(notice subtle difference in both text shadows)-
a hackish way render black text 8 times. first time offset top left, top center, top right, left, , on. may leave outline that's missing pixels in few places won't noticeable.
Comments
Post a Comment