php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25371 imagettftext() in gd2 does not create Japanese text
Submitted: 2003-09-02 19:08 UTC Modified: 2003-10-20 10:38 UTC
From: e_sumiya at f-den dot co dot jp Assigned: edink (profile)
Status: Closed Package: GD related
PHP Version: 4.3.x,5.x OS: win32
Private report: No CVE-ID: None
 [2003-09-02 19:08 UTC] e_sumiya at f-den dot co dot jp
Description:
------------
Imagettftext() in php_gd2.dll does not create Japanese text image. But php_gd.dll(in win32 zip package of 4.3.1) create the image properly.

Environment:
Japanese windows 2000 server + SP4
IIS



Reproduce code:
---------------
<?
$im = imagecreate (400,100);
$black = imagecolorallocate ($im,0,0,0);
$red = imagecolorallocate ($im,255,0,0);
$white = imagecolorallocate ($im,255,255,255);

imageline ($im,0,0,100,100,$red);
$font = "c:/winnt/fonts/MSGOTHIC.ttc";
$str = "??123";
$str = mb_convert_encoding($str, "UTF-8", "SJIS");
imagettftext($im,24,0,20,30,$white,$font,$str);
header("Content-type: image/png");
header("Cache-control: no-cache");
imagepng($im);
imagedestroy($im);
?>


Expected result:
----------------
The program produces a PNG image with one Japanese character(Unicode 611B) and three numbers(123).  

Actual result:
--------------
The program produces a PNG image with two Japanese characters(Unicode 30FB) and three numbers(123). 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-08 11:53 UTC] moriyoshi@php.net
Verified w/ win2k professional and the latest snap

 [2003-09-08 12:19 UTC] moriyoshi@php.net
Cannot reproduced with built-in gd and libfreetype2 (2.1.4)
I guess this has something to do with the freetype version..
 [2003-09-16 10:26 UTC] sniper@php.net
Edin, update to latest freetype for win32 build.

 [2003-10-20 10:38 UTC] edink@php.net
Freetype updated to 2.1.5.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 19:01:34 2024 UTC