From 4de105ae4a8185a14c55f1aa349bc78c101724b5 Mon Sep 17 00:00:00 2001 From: Rui Hirokawa Date: Mon, 16 Oct 2000 13:50:30 +0000 Subject: [PATCH] added a option to use the truetype string handling function in gd.\n it is useful for japanese because the truetype string function in gd supports some japanese encodings. --- ext/gd/config.m4 | 12 ++++++++++++ ext/gd/gd.c | 4 ++++ ext/gd/gdttf.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) 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 #include #include -- 2.40.0