On Monday 27 October 2003 21:11, Cranky wrote:
> > I use the function imageTTFtext allows you to specify a string with a
> > font and a font point size.
> With this function is it possible to specify the size of the text with
> width and height and not only with an integer ?
You can only specify the "height". As most fonts are proportional (ie
characters have differing widths) it would be meaningless to specify a width.
If you really need the text to fit within a certain width then draw your text
to a temp buffer image and then use imagecopyresampled().
> 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....
Try:
$arial = imageloadfont('./arial.ttf');
or use the full path to the font file.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Kill Ugly Radio
- Frank Zappa
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php