xref: /PHP-7.4/ext/gd/tests/bug48555.phpt (revision 26dfce7f)
1--TEST--
2Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines)
3--SKIPIF--
4<?php
5	if(!extension_loaded('gd')){ die('skip gd extension not available'); }
6	if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
7?>
8--FILE--
9<?php
10$cwd = __DIR__;
11$font = "$cwd/Tuffy.ttf";
12$box = ImageFTBBox(14, 0, $font, "Text without line-break");
13//echo 'Top without line-break: ' . $box[7] . "\n";
14$without_line_break = $box[7];
15$box = ImageFTBBox(14, 0, $font, "Text with\nline-break\none more");
16//echo 'Top with line-break: ' . $box[7] . "\n";
17$with_line_break = $box[7];
18
19var_dump($without_line_break);
20var_dump($with_line_break);
21if ($with_line_break==$without_line_break) {
22  echo "with line break == without line break".PHP_EOL;
23} else {
24  echo "with line break != without line break".PHP_EOL;
25}
26
27?>
28--EXPECTF--
29int(-%d)
30int(-%d)
31with line break == without line break
32