語法:intimagick::getFont(void)
參數:這個函數取無參數。
返回值:此函數成功時返回一個包含字體文件地址的字符串。下面的程序說明了 PHP 中的
Imagick::getFont() 函數:
程序 1:
//新建一個imagick對象
$imagick
=
new
Imagick();
// 安裝字體 - 確保
//相應的 .ttf 文件在
// 同一文件夾中可用。
$imagick
-> setFont (
` Windsong.ttf`
);
//獲取字體
$font
=
$imagick
-> getFont();
echo
$font
();
?>
輸出:/home/username/php/Windsong.ttf
程序2:
// 創建一個新的imagick對象
$imagick
=
new
Imagick();
// 安裝字體 - 確保
// 對應.ttf 文件位於
// 同一文件夾中。
$imagick
-> setFont (
`FFF_Tusj .ttf`
);
//獲取字體
$font
=
$imagick
-> getFont();
echo
$font
();
?>
輸出:/home/username/php/FFF_Tusj.ttf
鏈接: https://www.php.net/manual/en/imagick.getfont.php