GD::Persian - Persian UTF-8 support for GD module
The GD lib dosn't support Persian and Arabic chars propebly. It shows characters unsticky and reverse the sentence. This package get Persian UTF-8 charecter and replace it with proper characters that is readable in GD
use GD;
# create a new image use GD; use GD::Persian; use utf8; my $gd = new GD::Image(800,200); my $black = $gd->colorAllocate(0,0,0); my $white = $gd->colorAllocate(255,255,255); my $font_path = "/Library/Fonts/Tahoma.ttf"; $gd->stringFT($white,$font_path ,40 ,0 ,20 ,90 , GD::Persian::Convert("هوا بس ناجوان مردانه سرد است "), {linespacing=>0.6, charmap => 'Unicode', }); binmode STDOUT; print $gd->png;
Convert
Convert Persian UTF-8 characters to proper characters for using in images that is created by GD lib
Milad Rastian <milad@cpan.org>
Copyright (C) 2011 by Milad Rastian <milad@cpan.org>
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
https://github.com/slashmili/perl-gd-persian/issues
0.9
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'GD::Persian::Convert("هوا'. Assuming CP1252
To install GD::Persian, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GD::Persian
CPAN shell
perl -MCPAN -e shell install GD::Persian
For more information on module installation, please visit the detailed CPAN module installation guide.