php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30713 imagettftext() not work with chinese char
Submitted: 2004-11-07 14:08 UTC Modified: 2004-11-10 17:47 UTC
From: styeung at pegasus dot org dot hk Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.8 OS: win2k
Private report: No CVE-ID: None
 [2004-11-07 14:08 UTC] styeung at pegasus dot org dot hk
Description:
------------
ImageTTFText() doesn't work with some chinese(big5) TTF fonts and produce only UNKNOWN pattern and look alike Bug #28598. I have tried many version such as 4.3.6; 4.3.8 and also 4.3.10-dev, the bug still exists. As I know, it is the bug of GD (gdttf.c),  but I don't know how to fix it even I have read their suggestions. Can anyone help me. 

My script code :
.....
// 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,"arial.ttf",$string);
// Send the image
header("content-type: image/png\n\n");
ImagePng($png);
// Destroy image
ImageDestroy($png);
....

My current php/webserver is AppServ 2.4.1 
ie Apache/1.3.31 (Win32) PHP/4.3.10-dev (which manual upgarde from 4.3.8)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-10 17:47 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

imagettftext() doesn't support Big5, but it works with Unicode, so you must convert your string to unicode first.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 03 04:00:02 2025 UTC