請問怎樣解決字體找不到路徑問題Warning: imagettftext(): Could not find/open font in
<?php
$filename="des_big.jpg";
$fileInfo=getimagesize($filename);
$mime=$fileInfo['mime'];
$createFun=str_replace("/", "createfrom", $mime);
$outFun=str_replace("/",null,$mime);
$image=$createFun($filename);
$color=imagecolorallocatealpha($image, 255, 0, 0, 50);
$fontfile="../fonts/MSYH.TTF";
$text="muse.com";
imagettftext($image, 14, 0, 0, 14, $color, $fontfile, $text);
header("content-type:".$mime);
$outFun($image);
imagedestroy($image);
報錯
Warning: imagettftext(): Could not find/open font in
我的路徑寫的應該沒有問題,但是為什么打不開呢
2019-03-29
確實補齊就可以了??墒侵挥薪^對地址才能生效,相對地址就不行嗎?
2019-02-23
$fontfile="你把路徑直接補齊/fonts/MSYH.TTF";
如$fontfile = 'C:/wamp64/www/shopimooc/fonts/SIMKAI.TTF' ;