niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
GD incorrectly renders Arabic on Win32 machine
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Aqil Azmi
*nix forums beginner


Joined: 06 Mar 2005
Posts: 1

PostPosted: Sun Mar 06, 2005 8:28 pm    Post subject: GD incorrectly renders Arabic on Win32 machine Reply with quote

Hello,



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
GD.pm v2.19


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


<CODE>

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);
$im->transparent($white);

my $s = "\xC4 and \x{0394} look different\n\x{0642} + \x{0641} =
\x{0642}\x{0641}";

$im->stringFT($blue,'C:\WINNT\Fonts\tahoma.ttf',40,0,20,50,$s,
{linespacing=>0.9, charmap => 'Unicode'});

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

</CODE>

Thank you,

--aqil





--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 11:01 pm | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Problem with Win32-SerialPort over bluetooth @ windows + ... ctloh Perl 0 Fri Jul 21, 2006 8:08 am
No new posts Bug#379087: ITP: libcomplearn -- data-compression based i... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 7:40 am
No new posts Bug#379051: ITP: libsvm -- LibSVM is a machine-learning l... Rudi Cilibrasi devel 0 Thu Jul 20, 2006 9:00 pm
No new posts Virtual Machine that can run embedded Linux TCM embedded 1 Thu Jul 20, 2006 5:20 pm
No new posts canīt ether-wake a sarge machine Bruno Buys Debian 0 Thu Jul 20, 2006 5:00 pm

Guitar Lesson | Customer services | Recreation websites directory | Debt Consolidation | Low interest Credit Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1524s ][ Queries: 16 (0.0884s) ][ GZIP on - Debug on ]