Can anyone help me I'm not having much luck I want to try workout the ideal fontsize for my text based on the width of an image it's overlaying and the amount of characters in the text string. could anyone help me with the formula for this.
I got it semi-working but only due to the Infinite monkey theorem!
// gets text1 count
$charcount = strlen($line1);
// gets text1 size from count
$newsize = ($width / floor($charcount));
$add = ( 20 % $newsize );
$newsize = ($newsize + $add);
// Changes Font Size
$text1->setFontSize( $newsize );