cvs: /php3 ChangeLog acconfig.h config.h.in configure.in /php3/functions gd.c gdcache.c gdttf.c php3_gd.h
| From: | markonen | Date: | Mon, 12 Jul 1999 14:34:15 +0000 |
| Subject: | cvs: /php3 ChangeLog acconfig.h config.h.in configure.in /php3/functions gd.c gdcache.c gdttf.c php3_gd.h | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-8402@lists.php.net to get a copy of this message | ||
markonen Mon Jul 12 14:34:15 1999 EDT
Modified files:
/php3 ChangeLog acconfig.h config.h.in configure.in
/php3/functions gd.c gdcache.c gdttf.c php3_gd.h
Log:
Now compiles with freetype2: truetype.h and libfreetype.a
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.721 php3/ChangeLog:1.722
--- php3/ChangeLog:1.721 Mon Jul 12 13:20:16 1999
+++ php3/ChangeLog Mon Jul 12 14:34:15 1999
@@ -2,6 +2,8 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
??, Version 3.0.12
+- Initial Freetype2 support. You need to use the 1.2 compatibility
+ API <truetype.h> for now.. (markonen)
- added strtotime() function from <nsayer@quack.kfu.com> with some
modifications
- fix some problems in the socket buffering system (Sascha)
Index: php3/acconfig.h
diff -u php3/acconfig.h:1.103 php3/acconfig.h:1.104
--- php3/acconfig.h:1.103 Sat Jul 3 05:49:23 1999
+++ php3/acconfig.h Mon Jul 12 14:34:15 1999
@@ -349,4 +349,5 @@
#undef HAVE_LIBT1_OUTLINE
#define HAVE_LIBTTF 0
+#define HAVE_LIBFREETYPE 0
#define HAVE_POSIX 0
Index: php3/config.h.in
diff -u php3/config.h.in:1.180 php3/config.h.in:1.181
--- php3/config.h.in:1.180 Sat Jul 3 05:49:23 1999
+++ php3/config.h.in Mon Jul 12 14:34:15 1999
@@ -387,6 +387,7 @@
#undef HAVE_LIBT1_OUTLINE
#define HAVE_LIBTTF 0
+#define HAVE_LIBFREETYPE 0
#define HAVE_POSIX 0
/* The number of bytes in a int. */
Index: php3/configure.in
diff -u php3/configure.in:1.435 php3/configure.in:1.436
--- php3/configure.in:1.435 Mon Jul 12 13:20:16 1999
+++ php3/configure.in Mon Jul 12 14:34:15 1999
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.435 1999/07/12 17:20:16 markonen Exp $
+dnl $Id: configure.in,v 1.436 1999/07/12 18:34:15 markonen Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
@@ -774,18 +774,28 @@
AC_MSG_CHECKING(whether to include ttf support)
if test -n "$CHECK_TTF" ; then
for i in /usr /usr/local "$CHECK_TTF" ; do
+ if test -f "$i/include/truetype.h" ; then
+ FREETYPE_DIR="$i"
+ fi
if test -f "$i/include/freetype.h" ; then
TTF_DIR="$i"
fi
done
- if test -n "$TTF_DIR" ; then
- AC_DEFINE(HAVE_LIBTTF)
- AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib)
- AC_ADD_INCLUDE($TTF_DIR/include)
+ if test -n "$FREETYPE_DIR" ; then
+ AC_DEFINE(HAVE_LIBFREETYPE)
+ AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib)
+ AC_ADD_INCLUDE($FREETYPE_DIR/include)
AC_MSG_RESULT(yes)
else
- AC_MSG_RESULT(no)
+ if test -n "$TTF_DIR" ; then
+ AC_DEFINE(HAVE_LIBTTF)
+ AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib)
+ AC_ADD_INCLUDE($TTF_DIR/include)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
fi
else
AC_MSG_RESULT(no)
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.125 php3/functions/gd.c:1.126
--- php3/functions/gd.c:1.125 Mon Jun 21 20:26:38 1999
+++ php3/functions/gd.c Mon Jul 12 14:34:15 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.125 1999/06/22 00:26:38 jim Exp $ */
+/* $Id: gd.c,v 1.126 1999/07/12 18:34:15 markonen Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -65,7 +65,7 @@
#include <gdfontmb.h> /* 3 Medium bold font */
#include <gdfontl.h> /* 4 Large font */
#include <gdfontg.h> /* 5 Giant font */
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
# if PHP_31
# include "gdttf.h"
# else
@@ -77,7 +77,7 @@
#define M_PI 3.14159265358979323846
#endif
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
static void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int);
#endif
@@ -148,7 +148,7 @@
{"imagesx", php3_imagesxfn, NULL},
{"imagesy", php3_imagesyfn, NULL},
{"imagedashedline", php3_imagedashedline, NULL},
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
{"imagettfbbox", php3_imagettfbbox, NULL},
{"imagettftext", php3_imagettftext, NULL},
#endif
@@ -234,6 +234,9 @@
#if HAVE_LIBTTF
php3_printf(" with FreeType support");
#endif
+#if HAVE_LIBFREETYPE
+ php3_printf(" with FreeType 2 support");
+#endif
#if HAVE_LIBT1
php3_printf(" with Type1 support");
#endif
@@ -1736,7 +1739,7 @@
}
/* }}} */
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
#define TTFTEXT_DRAW 0
#define TTFTEXT_BBOX 1
Index: php3/functions/gdcache.c
diff -u php3/functions/gdcache.c:1.3 php3/functions/gdcache.c:1.4
--- php3/functions/gdcache.c:1.3 Mon Dec 28 04:34:53 1998
+++ php3/functions/gdcache.c Mon Jul 12 14:34:15 1999
@@ -1,5 +1,5 @@
/*
- * $Id: gdcache.c,v 1.3 1998/12/28 09:34:53 sas Exp $
+ * $Id: gdcache.c,v 1.4 1999/07/12 18:34:15 markonen Exp $
*
* Caches of pointers to user structs in which the least-recently-used
* element is replaced in the event of a cache miss after the cache has
@@ -42,7 +42,7 @@
#else
#include "config.h"
#endif
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
#include "gdcache.h"
@@ -198,4 +198,4 @@
#endif
-#endif /* HAVE_LIBTTF */
+#endif /* HAVE_LIBTTF|HAVE_LIBFREETYPE */
Index: php3/functions/gdttf.c
diff -u php3/functions/gdttf.c:1.19 php3/functions/gdttf.c:1.20
--- php3/functions/gdttf.c:1.19 Sun Jan 24 17:41:45 1999
+++ php3/functions/gdttf.c Mon Jul 12 14:34:15 1999
@@ -2,14 +2,14 @@
/* */
/* John Ellson ellson@lucent.com */
-/* $Id: gdttf.c,v 1.19 1999/01/24 22:41:45 rasmus Exp $ */
+/* $Id: gdttf.c,v 1.20 1999/07/12 18:34:15 markonen Exp $ */
#if WIN32|WINNT
#include "config.w32.h"
#else
#include "config.h"
#endif
-#if HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -17,7 +17,11 @@
#include <gd.h>
#include "gdttf.h"
#include "gdcache.h"
+#if HAVE_LIBFREETYPE
+#include <truetype.h>
+#else
#include <freetype.h>
+#endif
/* number of fonts cached before least recently used is replaced */
#define FONTCACHESIZE 6
@@ -379,7 +383,11 @@
a->cos_a = cos(a->angle);
a->engine = b->engine;
if ((err = TT_Open_Face(*b->engine, a->fontname, &a->face))) {
+#if HAVE_LIBFREETYPE
+ if (err == 0x008) { /* The FT2 oldapi is missing this code */
+#else
if (err == TT_Err_Could_Not_Open_File) {
+#endif
*error = "Could not find/open font";
}
else {
@@ -852,7 +860,7 @@
return (char *)NULL;
}
-#endif /* HAVE_LIBTTF */
+#endif /* HAVE_LIBTTF|HAVE_LIBFREETYPE */
/*
* Local variables:
Index: php3/functions/php3_gd.h
diff -u php3/functions/php3_gd.h:1.33 php3/functions/php3_gd.h:1.34
--- php3/functions/php3_gd.h:1.33 Tue Jun 1 18:04:25 1999
+++ php3/functions/php3_gd.h Mon Jul 12 14:34:15 1999
@@ -29,7 +29,7 @@
*/
-/* $Id: php3_gd.h,v 1.33 1999/06/01 22:04:25 jah Exp $ */
+/* $Id: php3_gd.h,v 1.34 1999/07/12 18:34:15 markonen Exp $ */
#ifndef _PHP3_GD_H
#define _PHP3_GD_H
@@ -93,7 +93,7 @@
extern void php3_free_gd_font(gdFontPtr);
extern void _php3_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int);
extern void php3_imagedashedline(INTERNAL_FUNCTION_PARAMETERS);
-#ifdef HAVE_LIBTTF
+#if HAVE_LIBTTF|HAVE_LIBFREETYPE
extern void php3_imagettfbbox(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagettftext(INTERNAL_FUNCTION_PARAMETERS);
#endif