Merge text with image
<p>I'm trying to merge a textstring with an image. I've found examples here on Stackoverflwo on how to do this, but all I get i jibberish when I load the script. I think it's a font problem, but I don't know how to solve this. I've placed the True type font (arial) in the same directory as the script. Suggestions? Here's my code:  </p>

<pre><code>&lt;?php


$im = imagecreatefromjpeg('image.jpg');  

//The numbers are the RGB values of the color you want to use 
$black = ImageColorAllocate($im, 255, 255, 255); 

//The canvas's (0,0) position is the upper left corner 
//So this is how far down and to the right the text should start 
$start_x = 10; 
$start_y = 20; 

$font = 'arial.ttf';


Imagettftext($im, 12, 0, $start_x, $start_y, $black, $font, 'text to write'); 

//Creates the jpeg image and sends it to the browser 
//100 is the jpeg quality percentage 

Imagejpeg($im, '', 100); 

ImageDestroy($im)
?&gt;
</code></pre>
