chanchelkumar Posted February 5, 2009 Share Posted February 5, 2009 Hi all, I tried to create an curved image with the given text.. using.. <?php header("Content-type: image/png"); $im = imagecreate(400,200); $white = imagecolorallocate($im, 255,255,255); $black = imagecolorallocate($im, 0,0,0); $cx = 100; $cy = 100; $cr = 60; $font=$font = '../fonts/Varsity.ttf'; $fontsize = 40; /*$cx = 0; $cy = $fontsize-2; $cr = 80;*/ if (isset($_REQUEST["text"])) { $text = $_REQUEST["text"]; } else { $text = 'HELLO WORLD'; } $length = strlen($text); $degDelta = 180 / $length; if ($length > 0) { $color = $black; for ($x = 0; $x < $length; $x++) { // Circular Text $AX = $cx - cos(deg2rad($degDelta * $x)) * $cr; $AY = $cy - sin(deg2rad($degDelta * $x)) * $cr; imagettftext($im,$fontsize, -($degDelta * $x + $degDelta / 2)+90 , $AX, $AY, $color, $font, $text[$x]); } } imagepng($im); imagedestroy($im); ?> This is working fine.. when i tried to change the font color , it also changes.. but i want to change the border color of the font along with the inner color of the font.. Any body can help me on this issue.. to apply two colors to the font.. Is It possible.. or please give me hint? thanks in advance.. Link to comment https://forums.phpfreaks.com/topic/143919-to-color-text-in-an-image-created-using-php/ Share on other sites More sharing options...
chanchelkumar Posted February 6, 2009 Author Share Posted February 6, 2009 Any clue for this issue??? Link to comment https://forums.phpfreaks.com/topic/143919-to-color-text-in-an-image-created-using-php/#findComment-755724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.