【发布时间】:2014-12-03 06:21:24
【问题描述】:
我需要在由 php 函数创建的 png 文件中换行:imagettftext(); 它对我有用,但我需要换行:
$arrText=explode("\n",wordwrap($text,20,"\n"));
$y=5; //vertical position of text
foreach($arrText as $arr)
{
imagestring($image,10,15,$y,trim($arr),$white);
$y=$y+15;
}
但我不能将我的自定义字体与 imagestring() 一起使用。
最好的解决方案是什么?
【问题讨论】:
-
imagettftext 返回一个坐标数组。究竟你期望能够
trim()是什么? trim() 需要一个字符串