<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 20, 2013 at 3:08 PM, Wayne <span dir="ltr"><<a href="mailto:waynelists@machx.co.uk" target="_blank">waynelists@machx.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Why isn't this working (well it creates image but no text!)<br>
<br>
$origImage from elsewhere..... then<br>
<br>
<br>
/* black for the text */<br>
$black = imagecolorallocate($origImage, 0, 0, 0);<br>
<br>
/* put the text on the image */<br>
imagettftext($origImage, 72, 0, 0, 0, $black, "/home/j9accomm/public_html/j9photobooth/arial.ttf", "Hello World");<br>
<br>
/* save the image */<br>
<br>
imagejpeg($origImage,'uploads/thumbs/'."result.jpg");<br>
<br>
<br>
<br>
i've tried all manner of font paths etc in the font bit to no avail.<br>
<br>
<br>
cheers</blockquote><div><br></div><div>Hi Wayne<br></div><div><br></div><div>From a quick glance at the docs:  <a href="http://us2.php.net/imagettftext">http://us2.php.net/imagettftext</a><br><br></div><div>The x and y co-ordinate is the baseline of the text, as such I suspect you are drawing the text off the top of the image.<br>
<br></div><div>Try:<br><br>
imagettftext($origImage, 72, 0, 0, 72, $black, "/home/j9accomm/public_html/j9photobooth/arial.ttf", "Hello World");<br><br><br></div><div>Failing that, try isolating out a test case to provide your code.<br>
</div><div><br>Regards,<br></div><div>Chris<br></div></div></div></div>