]> granicus.if.org Git - php/commitdiff
We don't support FreeType 2 - let's stop pretending we do
authorMarko Karppinen <markonen@php.net>
Sat, 14 Oct 2000 23:04:26 +0000 (23:04 +0000)
committerMarko Karppinen <markonen@php.net>
Sat, 14 Oct 2000 23:04:26 +0000 (23:04 +0000)
ext/gd/config.m4
ext/gd/gdttf.c

index 7a385cf6b24aab502b737b74f26a49c3c4f6b645..2633da5c13a009d7a80f3abf138156e1b9d63cc8 100644 (file)
@@ -151,7 +151,7 @@ dnl A whole whack of possible places where this might be
 if test "$with_gd" != "no" && test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
   CHECK_TTF="yes"
   AC_ARG_WITH(ttf,
-  [  --with-ttf[=DIR]        GD: Include Freetype support],[
+  [  --with-ttf[=DIR]        GD: Include FreeType 1.x support],[
     if test $withval = "no" ; then
       CHECK_TTF=""
     else
@@ -159,12 +159,9 @@ if test "$with_gd" != "no" && test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
     fi
   ])
 
-  AC_MSG_CHECKING(whether to include ttf support)
+  AC_MSG_CHECKING(whether to include FreeType 1.x 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"
         unset TTF_INC_DIR
@@ -174,33 +171,21 @@ if test "$with_gd" != "no" && test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
         TTF_INC_DIR="$i/include/freetype"
       fi
     done
-    if test -n "$FREETYPE_DIR" ; then
-      AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+    if test -n "$TTF_DIR" ; then
+      AC_DEFINE(HAVE_LIBTTF,1,[ ])
       if test "$shared" = "yes"; then
-        GD_LIBS="$GD_LIBS -lfreetype"
-        GD_LFLAGS="$GD_LFLAGS -L$FREETYPE_DIR/lib"
-      else 
-        AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib)
+        GD_LIBS="$GD_LIBS -lttf"
+        GD_LFLAGS="$GD_LFLAGS -L$TTF_DIR/lib"
+      else
+        AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib)
+      fi
+      if test -z "$TTF_INC_DIR"; then
+        TTF_INC_DIR="$TTF_DIR/include"
       fi
-      AC_ADD_INCLUDE($FREETYPE_DIR/include)
+      AC_ADD_INCLUDE($TTF_INC_DIR)
       AC_MSG_RESULT(yes)
     else
-      if test -n "$TTF_DIR" ; then
-        AC_DEFINE(HAVE_LIBTTF,1,[ ])
-        if test "$shared" = "yes"; then
-          GD_LIBS="$GD_LIBS -lttf"
-          GD_LFLAGS="$GD_LFLAGS -L$TTF_DIR/lib"
-        else
-          AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib)
-        fi
-        if test -z "$TTF_INC_DIR"; then
-          TTF_INC_DIR="$TTF_DIR/include"
-        fi
-        AC_ADD_INCLUDE($TTF_INC_DIR)
-        AC_MSG_RESULT(yes)
-      else
-        AC_MSG_RESULT(no)
-      fi
+      AC_MSG_RESULT(no)
     fi
   else
     AC_MSG_RESULT(no)
@@ -247,21 +232,6 @@ dnl SuSE 6.x package structure
     GD_INCLUDE="/usr/include/gd"
   fi
 
-  AC_MSG_CHECKING(whether to enable 4bit antialias hack with FreeType2)
-  AC_ARG_ENABLE(freetype-4bit-antialias-hack,
-  [  --enable-freetype-4bit-antialias-hack  
-                          GD: Include support for FreeType2 (experimental).
-  ],[
-  if test "$enableval" = "yes" ; then
-    AC_DEFINE(FREETYPE_4BIT_ANTIALIAS_HACK, 1, [ ])
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-  fi
-  ],[
-    AC_MSG_RESULT(no)
-  ])
-  
   AC_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
   AC_ADD_INCLUDE($GD_INCLUDE)
   PHP_EXTENSION(gd, $shared)
index 14b1744552386a25d8ada5dda8e6ac1f38d5c575..549028643f785cdc54ec63207206461aca7f54f5 100644 (file)
@@ -9,7 +9,7 @@
 #else
 #include "php_config.h"
 #endif
-#if HAVE_LIBTTF|HAVE_LIBFREETYPE
+#if HAVE_LIBTTF
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <gd.h>
 #include "gdttf.h"
 #include "gdcache.h"
-#if HAVE_LIBFREETYPE
-#include <truetype.h>
-#else
 #include <freetype.h>
-#endif
 
 #ifndef HAVE_GDIMAGECOLORRESOLVE
 extern int gdImageColorResolve(gdImagePtr, int, int, int);
@@ -39,11 +35,7 @@ extern int gdImageColorResolve(gdImagePtr, int, int, int);
 #define BITMAPCACHESIZE 8
 
 /* number of antialias color lookups cached */
-#if FREETYPE_4BIT_ANTIALIAS_HACK
-#define TWEENCOLORCACHESIZE 128
-#else
 #define TWEENCOLORCACHESIZE 32
-#endif
 
 /* ptsize below which anti-aliasing is ineffective */
 #define MINANTIALIASPTSIZE 0
@@ -52,11 +44,7 @@ extern int gdImageColorResolve(gdImagePtr, int, int, int);
 #define RESOLUTION 72
 
 /* Number of colors used for anti-aliasing */
-#if FREETYPE_4BIT_ANTIALIAS_HACK
-#define NUMCOLORS 16
-#else
 #define NUMCOLORS 4
-#endif
 
 /* Line separation as a factor of font height.  
       No space between if LINESPACE = 1.00 
@@ -355,11 +343,7 @@ fontFetch ( char **error, void *key )
        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 {
@@ -866,7 +850,7 @@ gdttf(gdImage *im, int *brect, int fg, char *fontname,
     return (char *)NULL;
 }
    
-#endif /* HAVE_LIBTTF|HAVE_LIBFREETYPE */
+#endif /* HAVE_LIBTTF */
 
 /*
  * Local variables: