/*create watermark*/
// Create the image
$im = imagecreate(460, 50);
// Create some colors
$grey = imagecolorallocate($im, 230, 231, 232);
$dark_grey = imagecolorallocate($im, 128, 130, 133);
// The text to draw
$text = "foobar";
// Set the enviroment variable for GD
putenv('GDFONTPATH=' . realpath('.'));
$font = 'Tondu_beta';
// Add the text
imagettftext($im, 15, 0, 15, 35, $dark_grey, $font, $text);
$wm_w = imagesx($im); //get width
$wm_h = imagesy($im); //get height
$wmresource = $im; //watermark resource
//imagejpeg($wmresource);
/*end watermark*/
글꼴 파일은 Tondu_Beta.ttf입니다. 위의 코드는 로컬 컴퓨터에서 정상적으로 작동했지만 라이브 서버에 업로드 한 후에 회색 상자 만 제공했습니다. 여기 뭐가 잘못 됐니? 감사합니다 ^^imagettftext() 작동하지 않음
UPDATE는 : Could not find/open font bla.bla..bla...
오류 로그를 확인하고 참조 글꼴 및 PHP 파일 모두 루트 디렉토리에있을 때
이 나를 위해 일한 사용해보십시오 . – ceejayoz
라이브 서버에 글꼴이 없을 수 있습니다 ... – Palladium
스크립트가 해당 폴더의 글꼴을 찾는 것을 알고 있습니까? – Palladium