1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 04:51:03 +02:00

We don't support FreeType 2 - let's stop pretending we do

This commit is contained in:
Marko Karppinen
2000-10-14 23:04:26 +00:00
parent 61a71738ae
commit cd7dae0676
2 changed files with 15 additions and 61 deletions

View 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
AC_ADD_INCLUDE($FREETYPE_DIR/include)
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
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)

View 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>
@@ -17,11 +17,7 @@
#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: