xref: /PHP-8.4/ext/gd/tests/bug48732.phpt (revision 0b8466f2)
1--TEST--
2Bug #48732 (TTF Bounding box wrong for letters below baseline)
3--EXTENSIONS--
4gd
5
6--SKIPIF--
7<?php
8    if(!function_exists('imagefttext')) die('skip imagefttext() not available');
9    if (!(imagetypes() & IMG_PNG)) {
10        die("skip No PNG support");
11    }
12?>
13--FILE--
14<?php
15$cwd = __DIR__;
16$font = "$cwd/Tuffy.ttf";
17$g = imagecreate(100, 50);
18$bgnd  = imagecolorallocate($g, 255, 255, 255);
19$black = imagecolorallocate($g, 0, 0, 0);
20$bbox  = imagettftext($g, 12, 0, 0, 20, $black, $font, "ABCEDFGHIJKLMN\nopqrstu\n");
21imagepng($g, "$cwd/bug48732.png");
22echo 'Left Bottom: (' . $bbox[0]  . ', ' . $bbox[1] . ')';
23?>
24--CLEAN--
25<?php @unlink(__DIR__ . '/bug48732.png'); ?>
26--EXPECT--
27Left Bottom: (0, 46)
28