Re: Change text size with GD
| From: | Cranky | Date: | Mon, 27 Oct 2003 13:11:32 +0000 |
| Subject: | Re: Change text size with GD | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167710@lists.php.net to get a copy of this message | ||
Thanks for your reply.
With this function is it possible to specify the size of the text with width and height and not only with an integer ?
Because the size of the rectangle on which I want to draw the text is various (I receive the size of the rectangle by parameter).
And other thing, I try to load a font to retrieve the width and height with imagefontwidth and imagefontheight.
My code is like that :
<?php
$arial = imageloadfont('arial.ttf');
echo '<br>WF : '.imagefontwidth($arial);
echo '<br>HF : '.imagefontheight($arial);
?>
And the file arial.ttf is in the same directory as this script
But when I load the page, I have this error message :
Warning: ImageFontLoad: error reading font in....
Thanks for your help
Chris Neale wrote:
I use the function imageTTFtext allows you to specify a string with a font and a font point size. Hope that helps. Chris -----Original Message----- From: Cranky [mailto:crankykong21@hotmail.com] Sent: 27 October 2003 10:16 To: php-general@lists.php.net Subject: [PHP] Change text size with GD Hello, I would like to draw text in a rectangle on an image. The text must take all the place in the rectangle. The trouble is that with imagestring(), there are only 5 fonts (1, 2, 3, 4, 5) and the bigger (5) is still too smaller for my rectangle. Is there another way to change the size of the text ? Thanks a lot