|
您的位置:学院
>> 编程开发 >>
PHP >> 在PHP中用GD函数输出TTF字体一例
|
在PHP中用GD函数输出TTF字体一例
|
$fontname="/usr/share/zhfont/TTF/gkai00mp.ttf";
header("Content-Type:image/png");
$im = imagecreate(200,30);
$white = ImageColorAllocate($im, 255,255,255);
$red = ImageColorAllocate($im,255,0,0);
$black = ImageColorAllocate($im,0,0,0);
ImageLine($im,0,0,200,30,$black);
ImageTTFText($im, 20, 0, 10, 20, $red, $fontname,"This is a TTF test.");
ImagePng($im);
ImageDestroy($im);
?>
|
|