From:             [EMAIL PROTECTED]
Operating system: FreeBSD4
PHP version:      4.0.4pl1
PHP Bug Type:     GD related
Bug description:  function ImageTTFText always get wrong chinese words from TTF ...

About Image function - ImageTTFText: always get wrong chinese words from TTF. 

To correct the problem: 

$ diff gdttf.c.orig gdttf.c 
690c690 
< ch = (ch * 256) + **next; 
--- 
> ch = (ch * 256) + ((**next) & 255);


Script to test:
<?php

// Create the image
$png = ImageCreate(200,200);
$bg = ImageColorAllocate($png,0,0,0);
$tx = ImageColorAllocate($png,255,128,128);

// Set Chinese words ("Chinese language" in Chinese Big5)
$string="";
         
// Chinese test (need mingli.ttf from MS-Win Chinese ver)
ImageTTFText($png,30,0,0,100,$tx,"/home/staff/cchsieh/public_html/gd/mingli.ttf

// Send the image
header("content-type: image/png\n\n");
ImagePng($png);

// Destroy image
ImageDestroy($png);

?>


-- 
Edit Bug report at: http://bugs.php.net/?id=10548&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to