GD incorrectly renders Arabic on Win32 machine

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!



The GD function stringFT fails to render Arabic properly. If you look at
the output of the code below, file out.png, the first line is ok, but
the second line is incorrect. In proper Arabic, the two letters in the
right side of equal sign must be joined, which is not the case here.
This not to mention that the entire second line must be reversed as
Arabic is RTL language so it ought to look like: YX = Y + X.

Here is my system's configuration:
Activestate perl v5.8.6 running on win2k
GD lib v2.0.33 v2.19

BTW the Tahoma ttf that comes standard with windows is an extended font
that includes among others the Arabic letters.


use strict;
use GD;
use Unicode::String qw(utf8 latin1 utf16);

open PICFILE, "> out.png" || die "Couldn't open image file: $!\n";

my $im = new GD::Image(760, 420);
my $white = $im->colorAllocate(255,255,255);
my $blue = $im->colorAllocate(0, 0, 255);

my $s = "\xC4 and \x look different\n\x + \x =

{linespacing=>0.9, charmap => 'Unicode'});

binmode PICFILE;
print PICFILE $im->png;
close PICFILE;  


Thank you,



Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

Site Timeline