Re: Fwd: Re: Subject: GD, UNICODE & RTL
| From: | Neil Smith | Date: | Tue, 07 Jan 2003 16:10:11 +0000 |
| Subject: | Re: Fwd: Re: Subject: GD, UNICODE & RTL | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-17718@lists.php.net to get a copy of this message | ||
Well if you *insist* on using GD - but I promise you, CSS is a better way to do this.
You will need to generate your string, spilt the string into an array of characters using the # character as a separator, then join your array in reverse order to a new (reversed) string.
You can then pass this string to the imagettftext function.
Of course, I am assuming you know how to use the GD functions, and that you have a suitable arabic font with corresponding Unicode characters.
Try this :
$myunicode="#4324#1221#1222#0133#0421#4219#1311";
// I made this string up - insert real unicode characters here
$mychararray=explode("#",$myunicode);
// Split into array of single unicode characters
$mychararray=array_reverse($mychararray);
// Reverse the array elements
$mynewunicode=join("#",$mychararray);
// Rejoin the elements with a # character
print("result so far :".$mynewunicode."<br>");
$mynewunicode="#".substr($mynewunicode,0,-1);
// Using join, there will be a trailing # and
// no required # at the start -- fix that
print($mynewunicode);
Then you can pass the $mynewunicode string to your TTF functions.
Hope that helps
Regards,
Neil Smith.
At 10:17 07/01/2003 +0000, you wrote:
Message-ID: <001c01c2b5fc$89147300$a652dbd9@mottaghi> From: "Mottaghi" <manghool@myrealbox.com> To: "PHP Windows Helplist" <php-windows@lists.php.net> Date: Tue, 7 Jan 2003 06:56:09 +0330 MIME-Version: 1.0 Content-Type: text/plain;charset="iso-8859-1"Content-Transfer-Encoding: 7bit Subject: Re: [PHP-WIN] Fwd: Re: Subject: GD, UNICODE & RTL Hi all and thanks, my problem: I want to create my bitmaps with GD functions, I call GD functions (like imagettftext()) and send them any RTL sentence, but it write and crate it LTR!!! thanks a lot :) ----- Original Message ----- From: "Neil Smith" <neil@fresh-toast.uklinux.net> To: <php-windows@lists.php.net> Sent: Monday, January 06, 2003 2:14 PM Subject: [PHP-WIN] Fwd: Re: Subject: GD, UNICODE & RTL Oops - missed a bit : Look here for mozilla information and examples on bi directional text: http://www.langbox.com/bidimozilla/ Also check "text-kashida-space" and "writing-mode " here : http://www.georgehernandez.com/xWebs/CSS/CSSAttributes.htm regards, Neil.Date: Mon, 06 Jan 2003 10:42:09 +0000 To: php-windows@lists.php.net From: Neil Smith <neil@fresh-toast.uklinux.net> Subject: Re: Subject: GD, UNICODE & RTL Cc: manghool@myrealbox.com Mottaghi - you might be better advised to investigate CSS for this on the browser :