I am trying to create an image with a circle and some text on it where the text curves around the inside of the circle. The circle is adaptive and I want the text inside it to be adaptive.
Until now I have the following code that generates a text that curves:
$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]);
}
Can you please tell me how can I make it adaptive, so it can adapt with the generated ellipse?
Hope this helps: