summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2000-10-16 13:50:30 +0000
committerRui Hirokawa <hirokawa@php.net>2000-10-16 13:50:30 +0000
commit4de105ae4a8185a14c55f1aa349bc78c101724b5 (patch)
tree2baa5f93b81fa06f46f6cb15e7148d5eb3b3b6f9
parent4086197d9550d38989e309888fac2e036671e709 (diff)
downloadphp-git-4de105ae4a8185a14c55f1aa349bc78c101724b5.tar.gz
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.
-rw-r--r--ext/gd/config.m412
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/gd/gdttf.c2
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>