这段代码为什么加中文水印出现乱码,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"; ??。
还是不对,还没有找到问题,我会继续找问题,找到后发帖上来。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号