From e21272934877caa7599100ad750acf5ce7c1c996 Mon Sep 17 00:00:00 2001 From: Damien Seguy Date: Tue, 22 May 2001 09:21:40 +0000 Subject: [PATCH] Added example for psloadfont git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@48143 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/image.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/functions/image.xml b/functions/image.xml index 707d24a3db..65e193cb8c 100644 --- a/functions/image.xml +++ b/functions/image.xml @@ -2151,6 +2151,23 @@ ImagePng($im); function returns false and prints a message describing what went wrong. + + +<?php +Header ("Content-type: image/jpeg"); +$im = ImageCreate (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); +?> + + See also ImagePSFreeFont.