水印乱码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:36:38
Original
1376 people have browsed it

这段代码为什么加中文水印出现乱码,php页面是utf-8的。
$size = 20;
$angle = 0;
$fontfile = "simpo.ttf";
$text = "一二三";
$filename = "imgs/1.jpg";
$img = imagecreatefromjpeg($filename);
$white = imagecolorallocate($img, 255, 255, 255);
$x = 450;
$y = 550;
imagettftext($img, $size, $angle, $x, $y, $white, $fontfile, $text);
imagejpeg($img,"imgs/1_water.jpg");
imagedestroy($img);


回复讨论(解决方案)

simpo.ttf 是什么字体?
仅 128k 应该不是汉字

你的字?不支持?字,
把$text = "一二三";改?$text="abc"; ??。

还是不对,还没有找到问题,我会继续找问题,找到后发帖上来。

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template