I had to use a full path to the font file or else I received errors from t1lib. Using just a filename, I received error 14. Using ./filename I received error 2.
imagepsloadfont
(PHP 4, PHP 5)
imagepsloadfont — Bir dosyadan bir PostScript Type 1 yazı tipi yükler
Açıklama
resource imagepsloadfont
( string
$dosyaismi
)
dosyaismi ile yolu belirtilen dosyadan bir
PostScript Type 1 yazı tipi yükler.
Değiştirgeler
-
dosyaismi -
Postscript yazı tipi dosyasının yolu.
Dönen Değerler
Herşey yolunda giderse geçerli bir yazıtipi tanıtıcısı döndürür. Aksi
takdirde FALSE döner.
Örnekler
Örnek 1 - imagepsloadfont() örneğ
<?php
// Yeni bir resim taslağı oluşturalım
$im = imagecreatetruecolor(350, 45);
// Renkleri ayarlayalım ve artalanı boyayalım
$siyah = imagecolorallocate($im, 0, 0, 0);
$beyaz = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 349, 44, $beyaz);
// Yazı tipini yükleyip resme bir metin yazalım
// ve yazı tipinine ayırdığımız belleği serbest bırakalım
$font = imagepsloadfont("bchbi.pfb");
imagepstext($im, "Deneme 123... Çalıştı!", $font, 32, $beyaz, $siyah, 32, 32);
imagepsfreefont($font);
// Resmi çıktılayalım
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
Notlar
Bilginize: Bu işlev sadece, PHP, --with-t1lib[=DİZİN] seçeneği ile derlenmişse kullanılabilir.
Ayrıca Bakınız
- imagepsfreefont() - Bir PostScript Type 1 yazı tipi tarafından kullanılan belleği serbest bırakır
seymour at itsyourdomain dot com ¶
9 years ago
