I am trying to create an image with a circle and text on it, where the text curves around the inside of the circle. The circle is responsive, and I want the text inside it to be adaptive.
So far, I have the following code that generates text that twists:
$row1="line1"; $degrees = (130/strlen($row1)); imageellipse ( $im , 250 , 250 , 390 , 390 , $black ); imageellipse ( $im , 250 , 250 , 398 , 398 , $black ); for ($i=0;$i<strlen($row1);$i++) { $a = ($degrees*$i)+126-strlen($row1)/3; $cos = cos(deg2rad($a)); $sin = sin(deg2rad($a)); $x = 0; $y = 180; $xt = round($cos*($x) - $sin*($y)); $yt = round($sin*($x) + $cos*($y)); imagettftext($im,14,180-($a),250+$xt,270+$yt,$red,'fonts\times.TTF',$row1[$i]); }
Could you tell me how I can make it adaptive so that it can adapt to the generated ellipse?
source share