@@ -68,11 +68,9 @@ static int le_gd, le_gd_font;
68
68
#include <gdfontl.h> /* 4 Large font */
69
69
#include <gdfontg.h> /* 5 Giant font */
70
70
71
- #ifdef ENABLE_GD_TTF
72
- # ifdef HAVE_LIBFREETYPE
73
- # include <ft2build.h>
74
- # include FT_FREETYPE_H
75
- # endif
71
+ #if HAVE_LIBFREETYPE
72
+ # include <ft2build.h>
73
+ # include FT_FREETYPE_H
76
74
#endif
77
75
78
76
#if defined(HAVE_GD_XPM ) && defined(HAVE_GD_BUNDLED )
@@ -83,7 +81,7 @@ static int le_gd, le_gd_font;
83
81
#define M_PI 3.14159265358979323846
84
82
#endif
85
83
86
- #ifdef ENABLE_GD_TTF
84
+ #if HAVE_LIBFREETYPE
87
85
static void php_imagettftext_common (INTERNAL_FUNCTION_PARAMETERS , int , int );
88
86
#endif
89
87
@@ -724,7 +722,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_imagegetclip, 0)
724
722
ZEND_ARG_INFO (0 , im )
725
723
ZEND_END_ARG_INFO ()
726
724
727
- #ifdef ENABLE_GD_TTF
728
725
#if HAVE_LIBFREETYPE
729
726
ZEND_BEGIN_ARG_INFO_EX (arginfo_imageftbbox , 0 , 0 , 4 )
730
727
ZEND_ARG_INFO (0 , size )
@@ -745,7 +742,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefttext, 0, 0, 8)
745
742
ZEND_ARG_INFO (0 , text )
746
743
ZEND_ARG_INFO (0 , extrainfo ) /* ARRAY_INFO(0, extrainfo, 0) */
747
744
ZEND_END_ARG_INFO ()
748
- #endif
749
745
750
746
ZEND_BEGIN_ARG_INFO (arginfo_imagettfbbox , 0 )
751
747
ZEND_ARG_INFO (0 , size )
@@ -991,7 +987,7 @@ static const zend_function_entry gd_functions[] = {
991
987
PHP_FE (imagegetclip , arginfo_imagegetclip )
992
988
PHP_FE (imagedashedline , arginfo_imagedashedline )
993
989
994
- #ifdef ENABLE_GD_TTF
990
+ #if HAVE_LIBFREETYPE
995
991
PHP_FE (imagettfbbox , arginfo_imagettfbbox )
996
992
PHP_FE (imagettftext , arginfo_imagettftext )
997
993
#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
@@ -1284,9 +1280,8 @@ PHP_MINFO_FUNCTION(gd)
1284
1280
#endif
1285
1281
#endif
1286
1282
1287
- #ifdef ENABLE_GD_TTF
1288
- php_info_print_table_row (2 , "FreeType Support" , "enabled" );
1289
1283
#if HAVE_LIBFREETYPE
1284
+ php_info_print_table_row (2 , "FreeType Support" , "enabled" );
1290
1285
php_info_print_table_row (2 , "FreeType Linkage" , "with freetype" );
1291
1286
{
1292
1287
char tmp [256 ];
@@ -1300,9 +1295,6 @@ PHP_MINFO_FUNCTION(gd)
1300
1295
#endif
1301
1296
php_info_print_table_row (2 , "FreeType Version" , tmp );
1302
1297
}
1303
- #else
1304
- php_info_print_table_row (2 , "FreeType Linkage" , "with unknown library" );
1305
- #endif
1306
1298
#endif
1307
1299
1308
1300
php_info_print_table_row (2 , "GIF Read Support" , "enabled" );
@@ -1358,13 +1350,9 @@ PHP_FUNCTION(gd_info)
1358
1350
1359
1351
add_assoc_string (return_value , "GD Version" , PHP_GD_VERSION_STRING );
1360
1352
1361
- #ifdef ENABLE_GD_TTF
1362
- add_assoc_bool (return_value , "FreeType Support" , 1 );
1363
1353
#if HAVE_LIBFREETYPE
1354
+ add_assoc_bool (return_value , "FreeType Support" , 1 );
1364
1355
add_assoc_string (return_value , "FreeType Linkage" , "with freetype" );
1365
- #else
1366
- add_assoc_string (return_value , "FreeType Linkage" , "with unknown library" );
1367
- #endif
1368
1356
#else
1369
1357
add_assoc_bool (return_value , "FreeType Support" , 0 );
1370
1358
#endif
@@ -3977,14 +3965,14 @@ PHP_FUNCTION(imagegetclip)
3977
3965
}
3978
3966
/* }}} */
3979
3967
3980
- #ifdef ENABLE_GD_TTF
3968
+ #if HAVE_LIBFREETYPE
3981
3969
#define TTFTEXT_DRAW 0
3982
3970
#define TTFTEXT_BBOX 1
3983
3971
#endif
3984
3972
3985
- #ifdef ENABLE_GD_TTF
3973
+ #if HAVE_LIBFREETYPE
3986
3974
3987
- #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
3975
+ #if HAVE_GD_FREETYPE
3988
3976
/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo])
3989
3977
Give the bounding box of a text using fonts via freetype2 */
3990
3978
PHP_FUNCTION (imageftbbox )
@@ -4000,7 +3988,7 @@ PHP_FUNCTION(imagefttext)
4000
3988
php_imagettftext_common (INTERNAL_FUNCTION_PARAM_PASSTHRU , TTFTEXT_DRAW , 1 );
4001
3989
}
4002
3990
/* }}} */
4003
- #endif /* HAVE_GD_FREETYPE && HAVE_LIBFREETYPE */
3991
+ #endif /* HAVE_GD_FREETYPE */
4004
3992
4005
3993
/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text)
4006
3994
Give the bounding box of a text using TrueType fonts */
@@ -4103,7 +4091,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
4103
4091
}
4104
4092
}
4105
4093
/* }}} */
4106
- #endif /* ENABLE_GD_TTF */
4094
+ #endif /* HAVE_LIBFREETYPE */
4107
4095
4108
4096
/* {{{ proto bool image2wbmp(resource im [, string filename [, int foreground]])
4109
4097
Output WBMP image to browser or file */
0 commit comments