php - Putting breaks into a text written on a image -


if write text on picture code below, code tries type text in 1 line. text overflows out of image in picture1. want write in picture2.

if there function in php enables writting in picture2 it?
if there no function that, how can writting code? can give me clue?

$text = $_post['text']; // text comes form.  $im = @imagecreate(700, 350)     or die("cannot initialize new gd image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagettftext($im, 22, 0, 5, 25,  $text_color, 'fonts/coolvetica rg.ttf', propertext($text)); imagepng($im, 'image.png'); 

picture1:

picture one


picture2:

enter image description here

put in bounding box using imagettfbbox() text wrap. there's full example on php.net:

http://www.php.net/manual/en/function.imagettfbbox.php


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -