diff options
| -rw-r--r-- | ext/gd/config.m4 | 12 | ||||
| -rw-r--r-- | ext/gd/gd.c | 4 | ||||
| -rw-r--r-- | ext/gd/gdttf.c | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 2633da5c13..ba5969b202 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -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) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 20933f698d..aaf00b4715 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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); diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c index 549028643f..ee58481e4c 100644 --- a/ext/gd/gdttf.c +++ b/ext/gd/gdttf.c @@ -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> |
