php - how to apply word wrap in wideimage texts? -
how can write long text small image using php wideimage?
here php code used,
$bg = wideimage::load("fbpostbg.png"); $final= $bg ->resize(400, 400); $canvas = $final ->getcanvas(); $canvas->usefont('verdana.ttf', 14, $final->allocatecolor(000, 000, 000)); $canvas->writetext('left +10', 'top +10', 'this text need write above image, quite long...'); $final->output('jpg', 90); this outputs text outside image canvas , can not seen...
need make word wrap in text write image , need image full text in it.
i'm new wideimage, me please.
use php's wordwrap function see: http://php.net/manual/en/function.wordwrap.php
$wrappedtext = wordwrap('this text need write above image, quite long...', 60, "\n"); $canvas->writetext('left +10', 'top +10',$wrappedtext);
Comments
Post a Comment