#include <gdfontl.h> /* 4 Large font */
#include <gdfontg.h> /* 5 Giant font */
-#ifdef ENABLE_GD_TTF
-# ifdef HAVE_LIBFREETYPE
-# include <ft2build.h>
-# include FT_FREETYPE_H
-# endif
+#if HAVE_LIBFREETYPE
+# include <ft2build.h>
+# include FT_FREETYPE_H
#endif
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
#define M_PI 3.14159265358979323846
#endif
-#ifdef ENABLE_GD_TTF
+#if HAVE_LIBFREETYPE
static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
#endif
ZEND_ARG_INFO(0, im)
ZEND_END_ARG_INFO()
-#ifdef ENABLE_GD_TTF
#if HAVE_LIBFREETYPE
ZEND_BEGIN_ARG_INFO_EX(arginfo_imageftbbox, 0, 0, 4)
ZEND_ARG_INFO(0, size)
ZEND_ARG_INFO(0, text)
ZEND_ARG_INFO(0, extrainfo) /* ARRAY_INFO(0, extrainfo, 0) */
ZEND_END_ARG_INFO()
-#endif
ZEND_BEGIN_ARG_INFO(arginfo_imagettfbbox, 0)
ZEND_ARG_INFO(0, size)
PHP_FE(imagegetclip, arginfo_imagegetclip)
PHP_FE(imagedashedline, arginfo_imagedashedline)
-#ifdef ENABLE_GD_TTF
+#if HAVE_LIBFREETYPE
PHP_FE(imagettfbbox, arginfo_imagettfbbox)
PHP_FE(imagettftext, arginfo_imagettftext)
#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
#endif
#endif
-#ifdef ENABLE_GD_TTF
- php_info_print_table_row(2, "FreeType Support", "enabled");
#if HAVE_LIBFREETYPE
+ php_info_print_table_row(2, "FreeType Support", "enabled");
php_info_print_table_row(2, "FreeType Linkage", "with freetype");
{
char tmp[256];
#endif
php_info_print_table_row(2, "FreeType Version", tmp);
}
-#else
- php_info_print_table_row(2, "FreeType Linkage", "with unknown library");
-#endif
#endif
php_info_print_table_row(2, "GIF Read Support", "enabled");
add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING);
-#ifdef ENABLE_GD_TTF
- add_assoc_bool(return_value, "FreeType Support", 1);
#if HAVE_LIBFREETYPE
+ add_assoc_bool(return_value, "FreeType Support", 1);
add_assoc_string(return_value, "FreeType Linkage", "with freetype");
-#else
- add_assoc_string(return_value, "FreeType Linkage", "with unknown library");
-#endif
#else
add_assoc_bool(return_value, "FreeType Support", 0);
#endif
}
/* }}} */
-#ifdef ENABLE_GD_TTF
+#if HAVE_LIBFREETYPE
#define TTFTEXT_DRAW 0
#define TTFTEXT_BBOX 1
#endif
-#ifdef ENABLE_GD_TTF
+#if HAVE_LIBFREETYPE
-#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
+#if HAVE_GD_FREETYPE
/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo])
Give the bounding box of a text using fonts via freetype2 */
PHP_FUNCTION(imageftbbox)
php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1);
}
/* }}} */
-#endif /* HAVE_GD_FREETYPE && HAVE_LIBFREETYPE */
+#endif /* HAVE_GD_FREETYPE */
/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text)
Give the bounding box of a text using TrueType fonts */
}
}
/* }}} */
-#endif /* ENABLE_GD_TTF */
+#endif /* HAVE_LIBFREETYPE */
/* {{{ proto bool image2wbmp(resource im [, string filename [, int foreground]])
Output WBMP image to browser or file */