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