note 55437 deleted from function.imagettfbbox by cmb
| From: | cmb@php.net | Date: | Sun, 04 Dec 2016 11:58:04 +0000 |
| Subject: | note 55437 deleted from function.imagettfbbox by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208164@lists.php.net to get a copy of this message | ||
Note Submitter: fernandez_marce at yahoo dot com
----
I would modify the last function imageprintWordWrapped() posted below. When it says:
// do the actual printing
$i = 0;
$i should be equal to 1, because if $top is greater than 0, the imagettftext() call will not work
for the first element in the $lines array ($top + lineHeight*$i) == $top when $i=0!
imagettftext($image, $textSize, 0, $leftStart, $top + $lineHeight * $i, $color, $font, $line);
$i++;
To sum up, replace
// do the actual printing
$i = 0;
with:
// do the actual printing
$i = 1;
Cheers,
Marcelo