ID:               45176
 User updated by:  heyond at yahoo dot com dot cn
 Reported By:      heyond at yahoo dot com dot cn
 Status:           Open
 Bug Type:         GD related
 Operating System: windows 2003
 PHP Version:      5.2.6
 Assigned To:      pajoye
 New Comment:

The completed script is:
<?php

define('BG1',  'DDD4BB');

header("Content-type: image/jpeg");

$word = 'abc';//$word = 'ºº×Ö'
$wordnum = 6;

$word = iconv('GBK', 'UTF-8', $word);

//$fontfile =
'./data/fonts/1.ttf';//http://www.guomo.com/data/fonts/1.ttf This file
'1.ttf' is normal
$fontfile =
'./data/fonts/174.ttf';//http://www.guomo.com/data/fonts/174.ttf This
file '174.ttf' is abnormal

$width = 30
$height = 40;

$fontsize = 20;
$x = 0;
$y = $fontsize + 10;

$im = imagecreate($wordnum * $width, $height);
$bgcolor = imagecolorallocate($im, hexdec(substr(BG1, 0, 2)),
hexdec(substr(BG1, 2, 2)), hexdec(substr(BG1, 4, 2)));
$fgcolor = imagecolorallocate($im, 0, 0, 0);
imagefill($im, 0, 0, $bgcolor);

imagettftext($im, $fontsize, 0, $x, $y, $fgcolor, $fontfile, $word);
imagejpeg($im);
imagedestroy($im);
exit;

?>


Previous Comments:
------------------------------------------------------------------------

[2008-06-05 06:38:14] heyond at yahoo dot com dot cn

http://www.guomo.com/data/fonts/174.ttf

------------------------------------------------------------------------

[2008-06-04 16:23:40] [EMAIL PROTECTED]

"Warning: imagettftext() [function.imagettftext]: Unable to find a
CharMap that I can handle in D:\www\guomo.com\ttf.php on line 33"

Is a pretty clear error message.

Please provide a link to the font you are using a complete script to
reproduce your problem.



------------------------------------------------------------------------

[2008-06-04 14:24:08] heyond at yahoo dot com dot cn

Description:
------------
I try to create a font image from ttf file, but I encounted a error :

Warning: imagettftext() [function.imagettftext]: Unable to find a
CharMap that I can handle in D:\www\mvc\ttf2.php on line 49

only few ttf file like this, I guess the freetypes version too lower.

Reproduce code:
---------------
imagettftext($im, $fontsize, 0, $x, $y, $fgcolor, $fontfile, 'abc');

Expected result:
----------------
a binary image.

Actual result:
--------------
Warning: imagettftext() [function.imagettftext]: Unable to find a
CharMap that I can handle in D:\www\guomo.com\ttf.php on line 33
ÿ?JFIFÿ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
quality ÿC    $.' ",#(7),01444'9=82<.342ÿC

2!!22222222222222222222222222222222222222222222222222ÿ(J"ÿ
ÿ?}!1AQa"q2‘?#B±ÁRÑð$3br?
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øù?
ÿ?w!1AQaq"2?B‘¡±Á
#3R?br?$4??&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿ
?õJ(¢¸Í‚????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ÿ


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45176&edit=1

Reply via email to