On Mon, 2 Sep 2002, Melvyn Sopacua wrote:

MS>>> Looking at the name of the function, I guess this is used for the __optional__ 
'extra' array, so why is this extension:
MS>>> 1) Claiming to support freetype
MS>>> 2) and subsequently disabeling all relevant functions
MS>>> 3) for an optional argument?
MS>>> 
MS>>> This applies to both 4.2.2 and 4.2.3.

Attached a patch, which works for me, with 4.2.2.

Please look it over, or explain why this is not a good idea.

Thanx,

Melvyn
Index: gd.c
===================================================================
RCS file: /repository/php4/ext/gd/gd.c,v
retrieving revision 1.179.2.2
diff -u -r1.179.2.2 gd.c
--- gd.c        4 Jun 2002 02:35:00 -0000       1.179.2.2
+++ gd.c        2 Sep 2002 01:33:23 -0000
@@ -2655,8 +2655,12 @@
    Give the bounding box of a text using fonts via freetype2 */
 PHP_FUNCTION(imageftbbox)
 {
-#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
+#if HAVE_LIBGD20 && HAVE_LIBFREETYPE
+# if HAVE_GD_STRINGFTEX
        php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1);
+# else
+       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 0);
+# endif
 #else 
        php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", 
get_active_function_name(TSRMLS_C));
        RETURN_FALSE;
@@ -2668,8 +2672,12 @@
    Write text to the image using fonts via freetype2 */
 PHP_FUNCTION(imagefttext)
 {
-#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
+#if HAVE_LIBGD20 && HAVE_LIBFREETYPE
+# if HAVE_GD_STRINGFTEX
        php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1);
+# else
+       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 0);
+# endif
 #else 
        php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", 
get_active_function_name(TSRMLS_C));
        RETURN_FALSE;
-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to