@@ -1426,18 +1426,17 @@ PHP_GD_API int phpi_get_le_gd(void)
1426
1426
PHP_FUNCTION (imageloadfont )
1427
1427
{
1428
1428
zval * ind ;
1429
- char * file ;
1430
- size_t file_name ;
1429
+ zend_string * file ;
1431
1430
int hdr_size = sizeof (gdFont ) - sizeof (char * );
1432
1431
int body_size , n = 0 , b , i , body_size_check ;
1433
1432
gdFontPtr font ;
1434
1433
php_stream * stream ;
1435
1434
1436
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "s " , & file , & file_name ) == FAILURE ) {
1435
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "P " , & file ) == FAILURE ) {
1437
1436
return ;
1438
1437
}
1439
1438
1440
- stream = php_stream_open_wrapper (file , "rb" , IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS , NULL );
1439
+ stream = php_stream_open_wrapper (file -> val , "rb" , IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS , NULL );
1441
1440
if (stream == NULL ) {
1442
1441
RETURN_FALSE ;
1443
1442
}
@@ -3898,24 +3897,24 @@ static void php_free_ps_enc(zend_resource *rsrc)
3898
3897
Load a new font from specified file */
3899
3898
PHP_FUNCTION (imagepsloadfont )
3900
3899
{
3901
- char * file ;
3902
- int file_len , f_ind , * font ;
3900
+ zend_string * file ;
3901
+ int f_ind , * font ;
3903
3902
#ifdef PHP_WIN32
3904
3903
zend_stat_t st ;
3905
3904
#endif
3906
3905
3907
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "s " , & file , & file_len ) == FAILURE ) {
3906
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "P " , & file ) == FAILURE ) {
3908
3907
return ;
3909
3908
}
3910
3909
3911
3910
#ifdef PHP_WIN32
3912
- if (VCWD_STAT (file , & st ) < 0 ) {
3911
+ if (VCWD_STAT (file -> val , & st ) < 0 ) {
3913
3912
php_error_docref (NULL , E_WARNING , "Font file not found (%s)" , file );
3914
3913
RETURN_FALSE ;
3915
3914
}
3916
3915
#endif
3917
3916
3918
- f_ind = T1_AddFont (file );
3917
+ f_ind = T1_AddFont (file -> val );
3919
3918
3920
3919
if (f_ind < 0 ) {
3921
3920
php_error_docref (NULL , E_WARNING , "T1Lib Error (%i): %s" , f_ind , T1_StrError (f_ind ));
@@ -3940,7 +3939,7 @@ PHP_FUNCTION(imagepscopyfont)
3940
3939
{
3941
3940
int l_ind, type;
3942
3941
gd_ps_font *nf_ind, *of_ind;
3943
- long fnt;
3942
+ zend_long fnt;
3944
3943
3945
3944
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &fnt) == FAILURE) {
3946
3945
return;
@@ -4009,7 +4008,8 @@ PHP_FUNCTION(imagepsencodefont)
4009
4008
{
4010
4009
zval * fnt ;
4011
4010
char * enc , * * enc_vector ;
4012
- size_t enc_len , * f_ind ;
4011
+ size_t enc_len ;
4012
+ int * f_ind ;
4013
4013
4014
4014
if (zend_parse_parameters (ZEND_NUM_ARGS (), "rs" , & fnt , & enc , & enc_len ) == FAILURE ) {
4015
4015
return ;
@@ -4105,10 +4105,9 @@ PHP_FUNCTION(imagepstext)
4105
4105
GLYPH * str_img ;
4106
4106
T1_OUTLINE * char_path , * str_path ;
4107
4107
T1_TMATRIX * transform = NULL ;
4108
- char * str ;
4109
- int str_len ;
4108
+ zend_string * str ;
4110
4109
4111
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "rsrlllll |lldl" , & img , & str , & str_len , & fnt , & size , & _fg , & _bg , & x , & y , & space , & width , & angle , & aa_steps ) == FAILURE ) {
4110
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "rSrlllll |lldl" , & img , & str , & fnt , & size , & _fg , & _bg , & x , & y , & space , & width , & angle , & aa_steps ) == FAILURE ) {
4112
4111
return ;
4113
4112
}
4114
4113
@@ -4171,7 +4170,7 @@ PHP_FUNCTION(imagepstext)
4171
4170
4172
4171
if (width ) {
4173
4172
extend = T1_GetExtend (* f_ind );
4174
- str_path = T1_GetCharOutline (* f_ind , str [0 ], size , transform );
4173
+ str_path = T1_GetCharOutline (* f_ind , str -> val [0 ], size , transform );
4175
4174
4176
4175
if (!str_path ) {
4177
4176
if (T1_errno ) {
@@ -4180,20 +4179,20 @@ PHP_FUNCTION(imagepstext)
4180
4179
RETURN_FALSE ;
4181
4180
}
4182
4181
4183
- for (i = 1 ; i < str_len ; i ++ ) {
4184
- amount_kern = (int ) T1_GetKerning (* f_ind , str [i - 1 ], str [i ]);
4185
- amount_kern += str [i - 1 ] == ' ' ? space : 0 ;
4182
+ for (i = 1 ; i < str -> len ; i ++ ) {
4183
+ amount_kern = (int ) T1_GetKerning (* f_ind , str -> val [i - 1 ], str -> val [i ]);
4184
+ amount_kern += str -> val [i - 1 ] == ' ' ? space : 0 ;
4186
4185
add_width = (int ) (amount_kern + width ) / extend ;
4187
4186
4188
4187
char_path = T1_GetMoveOutline (* f_ind , add_width , 0 , 0 , size , transform );
4189
4188
str_path = T1_ConcatOutlines (str_path , char_path );
4190
4189
4191
- char_path = T1_GetCharOutline (* f_ind , str [i ], size , transform );
4190
+ char_path = T1_GetCharOutline (* f_ind , str -> val [i ], size , transform );
4192
4191
str_path = T1_ConcatOutlines (str_path , char_path );
4193
4192
}
4194
4193
str_img = T1_AAFillOutline (str_path , 0 );
4195
4194
} else {
4196
- str_img = T1_AASetString (* f_ind , str , str_len , space , T1_KERNING , size , transform );
4195
+ str_img = T1_AASetString (* f_ind , str -> val , str -> len , space , T1_KERNING , size , transform );
4197
4196
}
4198
4197
if (T1_errno ) {
4199
4198
php_error_docref (NULL , E_WARNING , "T1Lib Error: %s" , T1_StrError (T1_errno ));
@@ -4231,12 +4230,12 @@ PHP_FUNCTION(imagepsbbox)
4231
4230
{
4232
4231
zval * fnt ;
4233
4232
zend_long sz = 0 , sp = 0 , wd = 0 ;
4234
- char * str ;
4233
+ zend_string * str ;
4235
4234
int i , space = 0 , add_width = 0 , char_width , amount_kern ;
4236
4235
int cur_x , cur_y , dx , dy ;
4237
4236
int x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 ;
4238
4237
int * f_ind ;
4239
- int str_len , per_char = 0 ;
4238
+ int per_char = 0 ;
4240
4239
int argc = ZEND_NUM_ARGS ();
4241
4240
double angle = 0 , sin_a = 0 , cos_a = 0 ;
4242
4241
BBox char_bbox , str_bbox = {0 , 0 , 0 , 0 };
@@ -4245,7 +4244,7 @@ PHP_FUNCTION(imagepsbbox)
4245
4244
ZEND_WRONG_PARAM_COUNT ();
4246
4245
}
4247
4246
4248
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "srl |lld" , & str , & str_len , & fnt , & sz , & sp , & wd , & angle ) == FAILURE ) {
4247
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "Srl |lld" , & str , & fnt , & sz , & sp , & wd , & angle ) == FAILURE ) {
4249
4248
return ;
4250
4249
}
4251
4250
@@ -4269,15 +4268,15 @@ PHP_FUNCTION(imagepsbbox)
4269
4268
space += T1_GetCharWidth (* f_ind , ' ' );
4270
4269
cur_x = cur_y = 0 ;
4271
4270
4272
- for (i = 0 ; i < str_len ; i ++ ) {
4273
- if (str [i ] == ' ' ) {
4271
+ for (i = 0 ; i < str -> len ; i ++ ) {
4272
+ if (str -> val [i ] == ' ' ) {
4274
4273
char_bbox .llx = char_bbox .lly = char_bbox .ury = 0 ;
4275
4274
char_bbox .urx = char_width = space ;
4276
4275
} else {
4277
- char_bbox = T1_GetCharBBox (* f_ind , str [i ]);
4278
- char_width = T1_GetCharWidth (* f_ind , str [i ]);
4276
+ char_bbox = T1_GetCharBBox (* f_ind , str -> val [i ]);
4277
+ char_width = T1_GetCharWidth (* f_ind , str -> val [i ]);
4279
4278
}
4280
- amount_kern = i ? T1_GetKerning (* f_ind , str [i - 1 ], str [i ]) : 0 ;
4279
+ amount_kern = i ? T1_GetKerning (* f_ind , str -> val [i - 1 ], str -> val [i ]) : 0 ;
4281
4280
4282
4281
/* Transfer character bounding box to right place */
4283
4282
x1 = new_x (char_bbox .llx , char_bbox .lly ) + cur_x ;
@@ -4306,7 +4305,7 @@ PHP_FUNCTION(imagepsbbox)
4306
4305
}
4307
4306
4308
4307
} else {
4309
- str_bbox = T1_GetStringBBox (* f_ind , str , str_len , space , T1_KERNING );
4308
+ str_bbox = T1_GetStringBBox (* f_ind , str -> val , str -> len , space , T1_KERNING );
4310
4309
}
4311
4310
4312
4311
if (T1_errno ) {
0 commit comments