technomyst1 Posted June 16, 2011 Share Posted June 16, 2011 Hi, I am using php imagettftext() function for converting bengali unicode text to image. but the problem is in the output image i am getting the bengali characters in wrong order. can anybody help? my code is : header('Content-type: image/gif'); mb_language('uni'); mb_internal_encoding('UTF-8'); $text = $_GET['text']; $font = 'Mohua.ttf'; $im = imagecreatetruecolor(125,25); $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 125, 25, $white); imagettftext($im, 12, 0, 10, 20, $black, $font, $text); imagegif($im); imagedestroy($im); Quote Link to comment https://forums.phpfreaks.com/topic/239563-text-to-image/ Share on other sites More sharing options...
cs.punk Posted June 16, 2011 Share Posted June 16, 2011 What do you mean by 'wrong order'? Quote Link to comment https://forums.phpfreaks.com/topic/239563-text-to-image/#findComment-1230667 Share on other sites More sharing options...
technomyst1 Posted June 16, 2011 Author Share Posted June 16, 2011 wrong order means in the attached image the 2nd character should come in first and the 6th character should come at 5th position. this type of character disorder problem also happened when we try to see bengali unicode websites. to view the characters in correct order we have to select in windows OS-- control panel->regional and language option -> install files for complex script and right to left languages . so this is the solution for viewing unicode bengali in correct order in web browser. but for converting text to image what should i do. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/239563-text-to-image/#findComment-1230705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.