Arabicに関しては、 PHP/GDの文字/グリフを逆にするためのライブラリーが必要です。たとえばhttp://sourceforge.net/projects/ar-php/またはhttp://www.ar-php.org/を参照してください。
PHP ファイルのエンコーディングがunicode/UTFであることを確認してください。
例 > メモ帳を開く > 名前を付けて保存 > UTF-8 としてエンコード:
imagettftextを使用した PHP でのアラビア語タイポグラフィの使用例:
<?php
// The text to draw
require('./I18N/Arabic.php');
$Arabic = new I18N_Arabic('Glyphs');
$font = './DroidNaskh-Bold.ttf';
$text = $Arabic->utf8Glyphs('لغةٌ عربيّة');
// Create the image
$im = imagecreatetruecolor(600, 300);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 599, 299, $white);
// Add the text
imagettftext($im, 50, 0, 90, 90, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im, "./output_arabic_image.png");
echo 'open: ./output_arabic_image.png';
imagedestroy($im);
?>
出力:
