From: Marko Karppinen Date: Sat, 14 Oct 2000 23:04:26 +0000 (+0000) Subject: We don't support FreeType 2 - let's stop pretending we do X-Git-Tag: php-4.0.4RC3~679 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd7dae067695e4c3ae78305c993ddec7484f50ce;p=php We don't support FreeType 2 - let's stop pretending we do --- diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 7a385cf6b2..2633da5c13 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -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) diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c index 14b1744552..549028643f 100644 --- a/ext/gd/gdttf.c +++ b/ext/gd/gdttf.c @@ -9,7 +9,7 @@ #else #include "php_config.h" #endif -#if HAVE_LIBTTF|HAVE_LIBFREETYPE +#if HAVE_LIBTTF #include #include #include @@ -17,11 +17,7 @@ #include #include "gdttf.h" #include "gdcache.h" -#if HAVE_LIBFREETYPE -#include -#else #include -#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: