Hi everyone,

This problem probably doesn't have any fix (or I think I doesn't anyway),
but maybe this email will be useful for other developers that need to
create portable scripts across a wide range of PHP and GD versions.

What I have found, and Rasmus helped me on that a few times over IRC, is
that GD 1.6.2 / 1.8.4 used a different version of the freetype library
(1.X) and the newer version of GD 2.0.1 actually needs freetype 2.X to
work (please correct me if I'm wrong).

Anyway, as I have said before here PHP 4.1.0 comes with a different
version of the GD DLL on the windows binary than it used to on 4.0.6. I'm
positive that 4.1's GD version is 1.6.2 and 4.0.6's was probably 2.0.1.
I'm not actually sure about 4.0.5, but I believe it was either 1.6.2 or
1.8.4.

In any case, what all of this meant to the graphing functions is that
there is different behavior on different versions of PHP. The windows
version of PHP might use GD 1.6.2 or even GD 2.0.1 (if compiled manually,
which is unprobable but possible).

ImageTTFText() is one of the functions that had its behavior changed, as
passing '10' to it as the font size parameter meant different things on
different versions of the GD library, which I believe is a consequence of
the unlying freetype requirement.

Anyway, all of this is just to warn everyone to be careful about this, as
your graphics will look in a different way than what you expected in some
cases.

Any comments or ideas would be helpful. If anyone knows the inner workings
of the freetype library and its standard for font sizes (ie metrics and
such), that would be great.

Just to give more details on what I needed to do - I actually ended up
parsing the output of phpinfo() with the output buffering functions to be
able to tell reliably which version of GD PHP is really using. This way I
could pass different font sizes to ImageTTFText(). Not very pretty, eh ?
;)

Cheers,
Joao

--
Joćo Prado Maia <[EMAIL PROTECTED]>
http://phpbrasil.com - php com um jeitinho brasileiro
--
Precisando de consultoria em desenvolvimento para a Internet ?
Impleo.net - http://impleo.net/?lang=br


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to