]> granicus.if.org Git - php/commitdiff
added a option to use the truetype string handling function in gd.\n it is useful...
authorRui Hirokawa <hirokawa@php.net>
Mon, 16 Oct 2000 13:50:30 +0000 (13:50 +0000)
committerRui Hirokawa <hirokawa@php.net>
Mon, 16 Oct 2000 13:50:30 +0000 (13:50 +0000)
ext/gd/config.m4
ext/gd/gd.c
ext/gd/gdttf.c

index 2633da5c13a009d7a80f3abf138156e1b9d63cc8..ba5969b202608a891c885b58953d7d8ee6455625 100644 (file)
@@ -42,6 +42,18 @@ AC_DEFUN(PHP_GD_XPM,[
         AC_CHECK_LIB(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])])
 ])
 
+AC_MSG_CHECKING(whether to enable truetype string function in gd)
+AC_ARG_ENABLE(gd-native-ttf,
+[  --enable-gd-imgstrttf  Enable TrueType string function in gd],[
+  if test "$enableval" = "yes" ; then
+    AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
+    AC_MSG_RESULT(yes)
+  else
+    AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
 
 shared=no
 AC_MSG_CHECKING(whether to include GD support)
index 20933f698deeda13623a203c92e0bc040dd63884..aaf00b47158823f7231ba80e417ed31532248578 100644 (file)
@@ -2043,7 +2043,11 @@ void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
        l = strlen(str);
        fontname = (unsigned char *) (*FONTNAME)->value.str.val;
 
+#ifdef USE_GD_IMGSTRTTF
+       error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y, str);
+#else
        error = gdttf(im, brect, col, fontname, ptsize, angle, x, y, str);
+#endif
 
        if (error) {
                php_error(E_WARNING, error);
index 549028643f785cdc54ec63207206461aca7f54f5..ee58481e4cf374e2f84a86bcdf9dc84da6be38ff 100644 (file)
@@ -9,7 +9,7 @@
 #else
 #include "php_config.h"
 #endif
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF && !defined(USE_GD_IMGSTRTTF)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>