(PHP 4, PHP 5)
imagepsloadfont — Charge une police PostScript Type 1 depuis un fichier
Charge une police PostScript Type 1 depuis le fichier filename .
En cas de succès, imagepsloadfont() retourne un index de police, qui pourra être utilisé pour des opérations ultérieures. Sinon, imagepsloadfont() retournera FALSE .
Exemple 1170. Exemple avec imagepsloadfont()
<?php
header
(
"Content-type: image/png"
);
$im
=
imagecreatetruecolor
(
350
,
45
);
$black
=
imagecolorallocate
(
$im
,
0
,
0
,
0
);
$white
=
imagecolorallocate
(
$im
,
255
,
255
,
255
);
imagefilledrectangle
(
$im
,
0
,
0
,
349
,
44
,
$white
);
$font
=
imagepsloadfont
(
"bchbi.pfb"
);
// ou bien situez un de vos fichiers .pfb
imagepstext
(
$im
,
"Test ... Ca marche!"
,
$font
,
32
,
$white
,
$black
,
32
,
32
);
imagepsfreefont
(
$font
);
imagepng
(
$im
);
imagedestroy
(
$im
);
?>
Note: Cette fonction n'est disponible que si PHP est compilé en utilisant --enable-t1lib[=DIR] .
imagepsfreefont() |