加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

使用PHP gd时“无法找到/打开字体”

发布时间:2020-05-25 09:18:23 所属栏目:PHP 来源:互联网
导读:我收到此错误无法找到/打开字体在 PHP中尝试imagettftext()时. 那里有字体文件.问题是什么? 我找到了字节 http://bytes.com/topic/php/answers/4833-gd-could-not-find-open-font-font-problem的答案 设置gdfontpath可能会有所帮助 $fontpath = realpath(.);

我收到此错误无法找到/打开字体在 PHP中尝试imagettftext()时.

那里有字体文件.问题是什么?

我找到了字节 http://bytes.com/topic/php/answers/4833-gd-could-not-find-open-font-font-problem的答案

设置gdfontpath可能会有所帮助

$fontpath = realpath('.'); //replace . with a different directory if needed
putenv('GDFONTPATH='.$fontpath);
$font = 't.otf';
...
$box = imagettfbbox($size,$font,$text);

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读