php中iconv()函数的使用和相关的配置问题,急! 不要用imageString用ImageTTFText还要装FREETYPE 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我用过ImageTTFText,imagettftext($idfer,12,0,$x+15,$y+7,$black,"c:/winnt/fonts/simkai.ttf",$string);总是报"font not found"错误。用phpinfo();看过了,FREETYPE,gd,都已经装好了。 font not found是说simkai.ttf没有找到,你自己去看看是否存在 有啊,就是楷体啊。我用imageString能写上字,英文和数字是正确的,就是中文是乱码 我把字体文件拷贝到脚本目录下,不报"font not found"了,但是图片无法显示,是个"叉"<?$im = imagecreate(400,300); $bkg = ImageColorAllocate($im, 0,0,0); $clr = ImageColorAllocate($im, 255,255,255); $fnt = "c:/winnt/fonts/simhei.ttf"; imagefill($im,0,0,$clr);$str = "hello"; //Imagestring($im, 10, 0, 0, $str, $bkg); //imagettftext($im, 10,0, 0, 0, $bkg,"../simkai.ttf",$str ); imagepng($im); ImageDestroy($im); ?>我用Imagestring()正常显示'hello"用imagettftext()就无法显示了。怎么办呢? 改成这样就OK了。<?phpHeader("Content-type: image/gif");$im = imagecreate(400,30);$black = ImageColorAllocate($im, 0,0,0);$white = ImageColorAllocate($im, 255,255,255);ImageTTFText($im, 20, 0, 10, 20, $white, "c:\windows\fonts\simkai.ttf", "Hello!");Imagepng($im);ImageDestroy($im);?> Header("Content-type: image/jpeg");//要在文件开头加上$text = "哈哈哈";$text = iconv("gb2312","UTF-8",$text);ImageTTFText($down, 12, 0, 50, 45, $white, "./simsun.ttc", $text); <?phpHeader("Content-type: image/gif");$im = imagecreate(400,30);$black = ImageColorAllocate($im, 0,0,0);$white = ImageColorAllocate($im, 255,255,255);ImageTTFText($im, 20, 0, 10, 20, $white, "c:\windows\fonts\simkai.ttf", "Hello!");Imagepng($im);ImageDestroy($im);?>不行,图片无法显示; php+mysql 查询结果分页显示 传值问题 问大家一个简单的php问题 怎样将ascii的英文字符转成unicode的开这种格式? 急!这样的 .htaccess 重写规则怎么写? 关于cookie保存,出现502错误,求解决方法 请求高手相助 购物车在线支付确认问题 PHP文件操作问题,请帮忙! PHP如何处理GB/BIG5? delphi--php 折线图
imagettftext($idfer,12,0,$x+15,$y+7,$black,"c:/winnt/fonts/simkai.ttf",$string);
总是报"font not found"错误。用phpinfo();看过了,FREETYPE,gd,都已经装好了。
我用imageString能写上字,英文和数字是正确的,就是中文是乱码
$im = imagecreate(400,300);
$bkg = ImageColorAllocate($im, 0,0,0);
$clr = ImageColorAllocate($im, 255,255,255);
$fnt = "c:/winnt/fonts/simhei.ttf";
imagefill($im,0,0,$clr);
$str = "hello";
//Imagestring($im, 10, 0, 0, $str, $bkg);
//imagettftext($im, 10,0, 0, 0, $bkg,"../simkai.ttf",$str );
imagepng($im);
ImageDestroy($im);
?>我用Imagestring()正常显示'hello"
用imagettftext()就无法显示了。怎么办呢?
<?php
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageTTFText($im, 20, 0, 10, 20, $white, "c:\windows\fonts\simkai.ttf", "Hello!");
Imagepng($im);
ImageDestroy($im);
?>
$text = "哈哈哈";
$text = iconv("gb2312","UTF-8",$text);
ImageTTFText($down, 12, 0, 50, 45, $white, "./simsun.ttc", $text);
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageTTFText($im, 20, 0, 10, 20, $white, "c:\windows\fonts\simkai.ttf", "Hello!");
Imagepng($im);
ImageDestroy($im);
?>不行,图片无法显示;