note 69511 added to function.iconv

From: Date: Fri, 08 Sep 2006 11:50:14 +0000
Subject: note 69511 added to function.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-116896@lists.php.net to get a copy of this message
hi, I need to convert arabic text to an Image some guys told me to use Imagettftext and Iconv it did not worked acuratly because of the following the arabic letters appear in revers order and not in the format I entered it in (letters in arabic language must be joined in somehow it not just simple like english language so the same letter have different shapes if it were in the start of the word and different view if it's in middle of the word and a 3rd view if it were in the end of the word) unfortunatley the text box I wrote this message in do the same so I need a converter for arabic words in the right format from charset windows-1256 to charset- utf-8 in a sequence where word arabic appears as it's viewed can any body help in that thanks in advance please consider the following code and send me the correction: <?php // Set the content-type header("Content-type: image/png"); // Create the image $im = imagecreatetruecolor(400, 30); // 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, 399, 29, $white); // The text to draw $text =iconv("windows-1256", "UTF-8", حاتم"); // Replace path by your own font path $font = 'tradbdo.ttf'; // Add some shadow to the text imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> ---- Server IP: 64.71.164.2 Probable Submitter: 196.202.17.156 ---- Manual Page -- http://www.php.net/manual/en/function.iconv.php Edit -- https://master.php.net/note/edit/69511 Del: integrated -- https://master.php.net/note/delete/69511/integrated Del: useless -- https://master.php.net/note/delete/69511/useless Del: bad code -- https://master.php.net/note/delete/69511/bad+code Del: spam -- https://master.php.net/note/delete/69511/spam Del: non-english -- https://master.php.net/note/delete/69511/non-english Del: in docs -- https://master.php.net/note/delete/69511/in+docs Del: other reasons-- https://master.php.net/note/delete/69511 Reject -- https://master.php.net/note/reject/69511 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116896) next »