mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
a375d54785
Cf. PR #6787. Closes GH-6994.
24 lines
634 B
PHP
24 lines
634 B
PHP
--TEST--
|
|
Bug #48732 (TTF Bounding box wrong for letters below baseline)
|
|
--EXTENSIONS--
|
|
gd
|
|
--SKIPIF--
|
|
<?php
|
|
if(!function_exists('imagefttext')) die('skip imagefttext() not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$cwd = __DIR__;
|
|
$font = "$cwd/Tuffy.ttf";
|
|
$g = imagecreate(100, 50);
|
|
$bgnd = imagecolorallocate($g, 255, 255, 255);
|
|
$black = imagecolorallocate($g, 0, 0, 0);
|
|
$bbox = imagettftext($g, 12, 0, 0, 20, $black, $font, "ABCEDFGHIJKLMN\nopqrstu\n");
|
|
imagepng($g, "$cwd/bug48732.png");
|
|
echo 'Left Bottom: (' . $bbox[0] . ', ' . $bbox[1] . ')';
|
|
?>
|
|
--CLEAN--
|
|
<?php @unlink(__DIR__ . '/bug48732.png'); ?>
|
|
--EXPECT--
|
|
Left Bottom: (0, 46)
|