Its so easy. Follow these step. First upload a arabic or hebrew font in the directory when my example script resides. I suppos ur font name is "arabic.ttf"
Then to draw a string in arabic using GD2, the script is
NB. Must place the script and font in same folde.
$height = 100;
$width = 200;
$word = "your Arabic/ Hebrew Text";
$fontname = "arabic.ttf";
$im = imagecreate($width,$height); //Create The canvas
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
$black = imagecolorallocate ($im, 0, 0, 0);
//Now Draw It
imagettftext ($im, 13, 0, 2, 20, $black, $fontname, $word);
-Thanks
Hasin Hayder
I am a BrainBench Certified PHP, VB, JavaScript, XML, FlashMX, DreamWeaverMX Developer.