|
imagepsloadfont (PHP 3 >= 3.0.9, PHP 4, PHP 5) imagepsloadfont -- 從檔案中加載一個 PostScript Type 1 字型 說明resource imagepsloadfont ( string filename )
若果一切標準,將返回一個合法的字型索引以備使用。否則返回
FALSE 並顯示一條訊息說明哪裡錯了,但不能直接讀取此訊息,因為輸出格式是圖像。
例子 1. imagepsloadfont() 例子
<?php header("Content-type: image/jpeg"); $im = imagecreatetruecolor(350, 45); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); $font = imagepsloadfont("bchbi.pfb"); // or locate your .pfb files on your machine imagepstext($im, "Testing... It worked!", $font, 32, $white, $black, 32, 32); imagepsfreefont($font); imagejpeg($im, "", 100); //for best quality...your mileage may vary imagedestroy($im); ?>
|
|
注: 本函數僅在
PHP 編譯時指定了 --enable-t1lib 時可用。
參見 imagepsfreefont()。
| |