업데이트 : TTF 파일이 테스트 후 표시됩니다. 업데이트 : 글꼴 파일의 상대 경로로 변경되었습니다. 아직도 작동하지 않습니다.PHP GD에서 오류가 발생했습니다
PHP를 통해 GD를 사용하여 이미지를 만들 때 다음 오류가 발생합니다.
[9월 1일 19시 44분 15초 화 2009] [오류] [클라이언트가 IP 주소] PHP 경고 : imagettftext()가 [function.imagettftext] : 에 은 찾을 수 없습니다 개방/글꼴 라인 38
에 /www/vhosts/website.com/htdocs/trial/TextToImage.class.php 나는 그것이 나에게 같은 오류가 제공되었을 때 글꼴의 경로를 변경했습니다. 파일을 폴더에 놓아 서버에 글꼴을 추가했습니다. 내가 뭘 놓치고 있니?
/**
* @name : makeImageF
*
* Function for create image from text with selected font.
*
* @param String $text : String to convert into the Image.
* @param String $font : Font name of the text.
* @param int $W : Width of the Image.
* @param int $H : Hight of the Image.
* @param int $X : x-coordinate of the text into the image.
* @param int $Y : y-coordinate of the text into the image.
* @param int $fsize : Font size of text.
* @param array $color : RGB color array for text color.
* @param array $bgcolor : RGB color array for background.
*
*/
public function makeImageF($text, $font="/www/vhosts/website.com/htdocs/trial/CENTURY.TTF", $W=200, $H=20, $X=0, $Y=0, $fsize=18, $color=array(0x0,0x0,0x0), $bgcolor=array(0xFF,0xFF,0xFF)){
$this->im = @imagecreate($W, $H)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($this->im, $bgcolor[0], $bgcolor[1], $bgcolor[2]); //RGB color background.
$text_color = imagecolorallocate($this->im, $color[0], $color[1], $color[2]); //RGB color text.
imagettftext($this->im, $fsize, $X, $Y, $fsize, $text_color, $font, $text);
}
클래스/색인 파일을 사용하여 글꼴을 배치하고 디버깅하기 위해 상대 경로를 통해 사용해 보았습니까? –